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

Function base64url

packages/core/test-servers/src/worker.test.ts:73–78  ·  view source on GitHub ↗
(buffer: ArrayBuffer)

Source from the content-addressed store, hash-verified

71};
72
73const base64url = (buffer: ArrayBuffer): string => {
74 const bytes = new Uint8Array(buffer);
75 let binary = "";
76 for (const byte of bytes) binary += String.fromCharCode(byte);
77 return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
78};
79
80const codeChallengeForVerifier = (verifier: string): Promise<string> =>
81 crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier)).then(base64url);

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected