tree: 7c02884eff392d60712692a2b72fc20b0e30c9a6 [path history] [tgz]
  1. .npmignore
  2. index.js
  3. package.json
  4. README.md
  5. test.js
node_modules/secure-compare/README.md

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.