MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / timingSafeEqual

Function timingSafeEqual

packages/encryption/src/timing-safe-equal.ts:13–23  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

11 * timing does not leak the length mismatch.
12 */
13export function timingSafeEqual(a: string, b: string): boolean {
14 const bufA = Buffer.from(a);
15 const bufB = Buffer.from(b);
16
17 if (bufA.length !== bufB.length) {
18 nodeTimingSafeEqual(bufA, bufA);
19 return false;
20 }
21
22 return nodeTimingSafeEqual(bufA, bufB);
23}

Callers 15

backendAuthMiddlewareFunction · 0.90
authenticateClientFunction · 0.90
approveRequestFunction · 0.90
POSTFunction · 0.90
GETFunction · 0.90
internalApiMiddlewareFunction · 0.90
controller.tsFile · 0.90
verifyAdminTokenFunction · 0.90
verifyTokenFunction · 0.90
auth.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected