node-lib

@wtasnorg/node-lib


@wtasnorg/node-lib / encode32

Function: encode32()

encode32(input, charset?): string

Defined in: base32.ts:81

Encode a string to Base32.

Parameters

input

string

The string to encode.

charset?

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

"rfc4648" "hex" "crockford"

Returns

string

The Base32 encoded string.

Example

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

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

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