MCPcopy Create free account
hub / github.com/hashintel/hash / timingSafeCompare

Function timingSafeCompare

libs/@local/hash-backend-utils/src/crypto.ts:9–14  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

7 * differ in length (which does leak length information, but not content).
8 */
9export 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}

Callers 3

linearWebhookFunction · 0.90

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected