(a: string, b: string)
| 7 | * differ in length (which does leak length information, but not content). |
| 8 | */ |
| 9 | export function timingSafeCompare(a: string, b: string): boolean { |
| 10 | if (a.length !== b.length) { |
| 11 | return false; |
| 12 | } |
| 13 | return timingSafeEqual(Buffer.from(a, "utf8"), Buffer.from(b, "utf8")); |
| 14 | } |
no test coverage detected