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

Function bytesToBase64

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

Source from the content-addressed store, hash-verified

355 });
356
357const bytesToBase64 = (bytes: Uint8Array): string => {
358 let binary = "";
359 const chunkSize = 0x8000;
360 for (let i = 0; i < bytes.length; i += chunkSize) {
361 binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
362 }
363 return btoa(binary);
364};
365
366const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => {
367 const compact = value.replace(/\s/g, "");

Callers 1

fileFromBinaryBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected