MCPcopy Create free account
hub / github.com/Hello-Application-XH/HelloGML / encodeBASE64

Function encodeBASE64

src/utils.ts:26–33  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

24}
25
26export function encodeBASE64(str: string): string {
27 const bytes = new TextEncoder().encode(str);
28 let binary = "";
29 for (let i = 0; i < bytes.byteLength; i++) {
30 binary += String.fromCharCode(bytes[i]);
31 }
32 return btoa(binary);
33}
34
35export function decodeBASE64(str: string): string {
36 const binary = atob(str);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected