Afanasev_Stepan_PIbd-21_IP/ИП 2 лаба/node_modules/secure-compare
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00
..
.npmignore Lab2-5 2024-01-10 16:11:49 +04:00
index.js Lab2-5 2024-01-10 16:11:49 +04:00
package.json Lab2-5 2024-01-10 16:11:49 +04:00
README.md Lab2-5 2024-01-10 16:11:49 +04:00
test.js Lab2-5 2024-01-10 16:11:49 +04: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.