node-lib

@wtasnorg/node-lib


@wtasnorg/node-lib / decode32

Function: decode32()

decode32(input, charset?): string

Defined in: src/base32.ts:136

Decode a Base32 string.

Parameters

input

string

The Base32 encoded string.

charset?

"rfc4648" | "hex" | "crockford"

The charset variant to use (default: “rfc4648”).

Returns

string

The decoded string.

Example

import { decode32 } from "./base32.js";

decode32("JBSWY3DP");
// => "Hello"

decode32("EHMP6SS=", "hex");
// => "test"

Throws

Error if the input contains invalid characters.