Base32Encoding

Radix 32 encoding/decoding scheme. Characters are case sensitive. Use base32 or base32hex for Base 32 encoding based on RFC 4648.

Constructor

function constructor(alphabet: string): this;

Parameters

  • alphabet: A string of 32 characters

Methods

Example

import { Base32Encoding } from "oslo/encoding";

const base32 = new Base32Encoding("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");
const encoded = base32.encode(data);
const decoded = base32.decodeIgnorePadding(encoded);