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

Function bytesFromBase64

packages/hosts/mcp/src/tool-server.ts:603–610  ·  view source on GitHub ↗
(base64: string)

Source from the content-addressed store, hash-verified

601};
602
603const bytesFromBase64 = (base64: string): Uint8Array => {
604 const binary = atob(base64);
605 const bytes = new Uint8Array(binary.length);
606 for (let index = 0; index < binary.length; index += 1) {
607 bytes[index] = binary.charCodeAt(index);
608 }
609 return bytes;
610};
611
612const decodeTextFile = (file: ToolFileValue): string => {
613 const text = new TextDecoder("utf-8", { fatal: false }).decode(bytesFromBase64(file.data));

Callers 1

decodeTextFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected