MCPcopy Create free account
hub / github.com/cloudflare/computer / decodeBase64

Function decodeBase64

examples/assets/src/index.ts:189–194  ·  view source on GitHub ↗
(b64: string)

Source from the content-addressed store, hash-verified

187// Decode a base64 string to bytes. atob is available in the Workers
188// runtime; map each character to its byte value.
189function decodeBase64(b64: string): Uint8Array {
190 const binary = atob(b64);
191 const bytes = new Uint8Array(binary.length);
192 for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
193 return bytes;
194}

Callers 1

#runModelMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected