MCPcopy Create free account
hub / github.com/cfwuya1/sublink-worker-admin / encodeBase64

Function encodeBase64

src/utils.js:12–20  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

10}
11
12export function encodeBase64(input) {
13 const encoder = new TextEncoder();
14 const utf8Array = encoder.encode(input);
15 let binaryString = '';
16 for (const byte of utf8Array) {
17 binaryString += String.fromCharCode(byte);
18 }
19 return base64FromBinary(binaryString);
20}
21
22export function decodeBase64(input) {
23 const binaryString = base64ToBinary(input);

Callers 1

handleRequestFunction · 0.90

Calls 1

base64FromBinaryFunction · 0.85

Tested by

no test coverage detected