MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / base64urlToBytes

Function base64urlToBytes

packages/worker-utils/src/hostname-label.ts:74–86  ·  view source on GitHub ↗
(encoded: string)

Source from the content-addressed store, hash-verified

72 const bytes = base64urlToBytes(encoded);
73 return bytesToBase64url(bytes) === encoded ? bytes : null;
74 } catch {
75 return null;
76 }
77}
78
79function bytesToBase32Hex(bytes: Uint8Array): string {
80 let output = '';
81 let buffer = 0;
82 let bits = 0;
83
84 for (const byte of bytes) {
85 buffer = (buffer << 8) | byte;
86 bits += 8;
87
88 while (bits >= 5) {
89 bits -= 5;

Callers 1

Calls 2

bytesToBase64urlFunction · 0.70
replaceMethod · 0.65

Tested by

no test coverage detected