secure-compare
Securely compare two strings, copied from cryptiles
Last updated 12 years ago by vdemedes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install secure-compare 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.0.1                                ...           latest (12 years ago)

2 Versions

  • 3.0.1                                ...           12 years ago
  • 0.9.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 1
This Month 4
Last Day 1
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE