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

Function safeEqual

apps/local/src/serve-shared.ts:32–36  ·  view source on GitHub ↗
(actual: string, expected: string)

Source from the content-addressed store, hash-verified

30};
31
32export const safeEqual = (actual: string, expected: string): boolean => {
33 const actualBytes = Buffer.from(actual);
34 const expectedBytes = Buffer.from(expected);
35 return actualBytes.length === expectedBytes.length && timingSafeEqual(actualBytes, expectedBytes);
36};
37
38const hostnameFromOrigin = (origin: string): string | null => {
39 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: parsing an untrusted Origin header that may be malformed

Callers 2

makeLocalIdentityLayerFunction · 0.90
hasBearerTokenFunction · 0.85

Calls 1

timingSafeEqualFunction · 0.85

Tested by

no test coverage detected