Skip to content

hkatzdev/secure-compare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

Run on Repl.it

Tests

$ deno test

License

secure-compare is released under the BSD 3 Clause license.

About

Constant-time comparison algorithm to prevent timing attacks (Deno edition)

Resources

License

Stars

Watchers

Forks

Packages

No packages published