PIbd-21_Zhirnova_A._E._Inte.../3 proba/node_modules/secure-compare
2023-12-06 21:05:45 +03:00
..
.npmignore Lab3new 2023-12-06 21:05:45 +03:00
index.js Lab3new 2023-12-06 21:05:45 +03:00
package.json Lab3new 2023-12-06 21:05:45 +03:00
README.md Lab3new 2023-12-06 21:05:45 +03:00
test.js Lab3new 2023-12-06 21:05:45 +03:00

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.