(b32: string)
| 84 | * ``` |
| 85 | */ |
| 86 | export 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 | } |
no test coverage detected