MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / timingSafeEqual

Function timingSafeEqual

apps/cloud/src/auth/handlers.ts:82–89  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

80};
81
82const timingSafeEqual = (a: string, b: string): boolean => {
83 if (a.length !== b.length) return false;
84 let diff = 0;
85 for (let i = 0; i < a.length; i++) {
86 diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
87 }
88 return diff === 0;
89};
90
91const requestHeaders = Effect.map(HttpServerRequest.HttpServerRequest.asEffect(), (req) => ({
92 ...req.headers,

Callers 2

handlers.tsFile · 0.85
safeEqualFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected