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

Function bytesToBase64

packages/plugins/openapi/src/sdk/invoke.ts:391–398  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

389 });
390
391const bytesToBase64 = (bytes: Uint8Array): string => {
392 let binary = "";
393 const chunkSize = 0x8000;
394 for (let i = 0; i < bytes.length; i += chunkSize) {
395 binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
396 }
397 return btoa(binary);
398};
399
400const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => {
401 const compact = value.replace(/\s/g, "");

Callers 1

fileFromBinaryBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected