scuffle
Prevent node.js timing attacks using a combination of Knuth Fisher-Yates shuffling and random sleep, where sleep time is defined in microseconds.
For example, when comparing a stored API key with the API key sent with a user request.
Install
$ npm install scuffle
Usage
const scuffle = ; scuffle;//=> true scuffle;//=> false scuffle;//=> false // Can use an object to define the min and max number of random microseconds to add to a comparison// default {minAddedTime: 0, maxAddedTime: 1e6}scuffle;//=> true scuffle;//=> Uncaught TypeError: Can only compare strings and arrays. Found: number and string// at scuffle.compare (<anonymous>:104:11)