Prevents timing attacks using Brad Hill's Double HMAC pattern to perform secure string comparison. Double HMAC avoids the timing atacks by blinding the timing channel using random time per attempt comparison against iterative brute force attacks.
npm install tsscmp
To compare secret values like authentication tokens, passwords or capability urls so that timing information is not leaked to the attacker.
var timingSafeCompare = ;var sessionToken = '127e6fbfe24a750e72930c';var givenToken = '127e6fbfe24a750e72930c';ifconsole;elseconsole;