MCPcopy Create free account
hub / github.com/p2r3/convert / bytesToBase64

Method bytesToBase64

src/handlers/htmlEmbed.ts:24–31  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

22 }
23
24 static bytesToBase64 (bytes: Uint8Array): string {
25 const chunks = [];
26 for (let i = 0; i < bytes.length; i += 32768) {
27 const byteChunk = bytes.subarray(i, i + 32768);
28 chunks.push(String.fromCharCode(...byteChunk));
29 }
30 return btoa(chunks.join(""));
31 }
32
33 async doConvert (
34 inputFiles: FileData[],

Callers 1

doConvertMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected