cs50/node_modules/secure-compare
Dr. Sascha Woitschetzki e55abc64ff http-server 2024-03-11 10:02:51 +07:00
..
.npmignore http-server 2024-03-11 10:02:51 +07:00
README.md http-server 2024-03-11 10:02:51 +07:00
index.js http-server 2024-03-11 10:02:51 +07:00
package.json http-server 2024-03-11 10:02:51 +07:00
test.js http-server 2024-03-11 10:02:51 +07:00

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.