secure-compare
Securely compare two strings, copied from cryptiles
Last updated 11 years ago by vdemedes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (11 years ago)

2 Versions

  • 3.0.1                                ...           11 years ago
  • 0.9.0                                ...           11 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |