|
%!s(int64=2) %!d(string=hai) anos | |
---|---|---|
.. | ||
.npmignore | %!s(int64=2) %!d(string=hai) anos | |
README.md | %!s(int64=2) %!d(string=hai) anos | |
index.js | %!s(int64=2) %!d(string=hai) anos | |
package.json | %!s(int64=2) %!d(string=hai) anos | |
test.js | %!s(int64=2) %!d(string=hai) anos |
Constant-time comparison algorithm to prevent timing attacks for Node.js. Copied from cryptiles by C J Silverio.
$ npm install secure-compare --save
var compare = require('secure-compare');
compare('hello world', 'hello world').should.equal(true);
compare('你好世界', '你好世界').should.equal(true);
compare('hello', 'not hello').should.equal(false);
$ npm test
secure-compare is released under the MIT license.