scmp
2.1.0 • Public • Published scmp
Safe, constant-time comparison of Buffers.
Install
npm install scmp
Why?
To minimize vulnerability against timing attacks.
Example
const scmp = require('scmp');
const Buffer = require('safe-buffer').Buffer;
const hash = Buffer.from('e727d1464ae12436e899a726da5b2f11d8381b26', 'hex');
const givenHash = Buffer.from('e727e1b80e448a213b392049888111e1779a52db', 'hex');
if (scmp(hash, givenHash)) {
console.log('good hash');
} else {
console.log('bad hash');
}
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 2.1.0
1,171,551
Version History
- VersionDownloads (Last 7 Days)
- 2.1.0
1,171,551
- 2.0.0
65,020
Package Sidebar
Install
Weekly Downloads