node-lib

@wtasnorg/node-lib


@wtasnorg/node-lib / decode32

Function: decode32()

decode32(input, charset?): string

Defined in: base32.ts:136

Decode a Base32 string.

Parameters

input

string

The Base32 encoded string.

charset?

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

"rfc4648" "hex" "crockford"

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.