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

Function bytesToBase64

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

Source from the content-addressed store, hash-verified

348 });
349
350const bytesToBase64 = (bytes: Uint8Array): string => {
351 let binary = "";
352 const chunkSize = 0x8000;
353 for (let i = 0; i < bytes.length; i += chunkSize) {
354 binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
355 }
356 return btoa(binary);
357};
358
359const normalizeBase64 = (value: string, encoding: "base64" | "base64url"): string => {
360 const compact = value.replace(/\s/g, "");

Callers 1

fileFromBinaryBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected