MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / base64UrlDecode

Function base64UrlDecode

telemetry-dashboard/src/auth.ts:39–48  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

37}
38
39function base64UrlDecode(text: string): Uint8Array | null {
40 try {
41 const binary = atob(text.replace(/-/g, '+').replace(/_/g, '/'));
42 const bytes = new Uint8Array(binary.length);
43 for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
44 return bytes;
45 } catch {
46 return null;
47 }
48}
49
50// Importing the HMAC key costs a round through WebCrypto; cache it per isolate.
51// A secret rotation ships a new deployment, which means new isolates.

Callers 1

hasValidSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected