Package Exports
- tsse
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tsse) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tsse
⏱ Timing safe string equals.
Install
$ npm install --save tsseUsage
const tsse = require('tsse');
const hash = '0a4d55a8d778e5022fab701977c5d840bbc486d0';
const givenHash = '1265a5eb08997ced279d3854629cba68a378b528';
if (tsse(hash, givenHash)) {
console.log('good hash');
} else {
console.log('bad hash');
}
//=> falseAPI
tsse(strA, strB)
Does a constant-time String comparison using crypto native timingSafeEqual if available or the Brad Hill's Double HMAC pattern if not.
strA
Type: string
The first string.
strB
Type: string
The second string.
Authors
- Simone Primarosa - simonepri
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.