@ansugroup/timing-safe-equal
Nodejs, 浏览器
副本包 safe-compare 用 TypeScript 重写,用于安苏组的内部使用. crypto.timingSafeEqual 用于浏览器.
安装
yarn add @ansugroup/timing-safe-equal
使用量
import timingSafeEqual from "@ansugroup/timing-safe-equal";
timingSafeEqual("hello world", "hello world"); // -> true
timingSafeEqual("hello", "not hello"); // -> false
timingSafeEqual("hello foo", "hello bar"); // -> false
许可证
麻省理工学院