base32
import { ALPHABET } from "#codebase/tcmts/core/hash"; export function base32(bytes: Uint8Array): string { let out = ""; let bits = 0; let value = 0; for (const byte of bytes) { value = (value << 8) | byte; bits += 8; while (bits >= 5) { out += ALPHABET[(value >>> (bits - 5)) & 31]; bits -= 5; } } if (bits > 0) out += ALPHABET[(value << (5 - bits)) & 31]; return out; }