Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/encoding/base32.ts

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
import * as mod from "https://deno.land/std@0.170.0/encoding/base32.ts";

encode and decode for base32 encoding.

Modified from https://github.com/beatgammit/base64-js

This module is browser compatible.

Examples

Example 1

import {
  decode,
  encode,
} from "https://deno.land/std@0.170.0/encoding/base32.ts";

const b32Repr = "RC2E6GA=";

const binaryData = decode(b32Repr);
console.log(binaryData);
// => Uint8Array [ 136, 180, 79, 24 ]

console.log(encode(binaryData));
// => RC2E6GA=

Functions

Returns number of bytes encoded in the given RFC4648 base32 string input.

Decodes a given RFC4648 base32 encoded string.

Encodes a given Uint8Array into RFC4648 base32 representation