MCPcopy Create free account
hub / github.com/denoland/std / decodeBase32

Function decodeBase32

encoding/base32.ts:86–96  ·  view source on GitHub ↗
(b32: string)

Source from the content-addressed store, hash-verified

84 * ```
85 */
86export function decodeBase32(b32: string): Uint8Array_ {
87 const output = new TextEncoder().encode(b32) as Uint8Array_;
88 if (output.length % 8) {
89 throw new TypeError(
90 `Invalid base32 string: length (${output.length}) must be a multiple of 8`,
91 );
92 }
93 // deno-lint-ignore no-explicit-any
94 return new Uint8Array((output.buffer as any)
95 .transfer(decode(output, 0, 0, rAlphabet, padding)));
96}

Callers 2

fnFunction · 0.90

Calls 1

decodeFunction · 0.90

Tested by

no test coverage detected