secure-compare

3.0.1 • Public • Published

secure-compare

Constant-time comparison algorithm to prevent timing attacks for Node.js. Copied from cryptiles by C J Silverio.

Installation

$ npm install secure-compare --save

Usage

var compare = require('secure-compare');
 
compare('hello world', 'hello world').should.equal(true);
compare('你好世界', '你好世界').should.equal(true);
 
compare('hello', 'not hello').should.equal(false);

Tests

$ npm test

License

secure-compare is released under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.1
    2,129,777
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.1
    2,129,777
  • 0.9.0
    1

Package Sidebar

Install

npm i secure-compare

Weekly Downloads

2,129,778

Version

3.0.1

License

MIT

Last publish

Collaborators

  • vdemedes