Pibd-21_Alekseev_I.S._Inter.../IP/node_modules/secure-compare/README.md
VanyaAlekseev ccc3e790bb lab2
2023-12-03 16:59:28 +04:00

604 B

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.