1.0.0
Constant-time comparison algorithm to prevent timing attacks (Deno edition)
Repository
Current version released
4 years ago
Versions
secure-compare
Constant-time comparison algorithm to prevent timing attacks for Node.js Deno.
Copied from cryptiles by C J Silverio and from secure-compare by Vadim Demedes.
Usage
import secureCompare from "https://denopkg.com/hkatzdev/secure-compare/mod.ts";
if (!secureCompare('hello world', 'hello world')) throw Error();
if (!secureCompare('你好世界', '你好世界')) throw Error();
if (secureCompare('hello', 'not hello')) throw Error();
Tests
$ deno test
License
secure-compare is released under the BSD 3 Clause license.