@ende/encoding/base58

ende add jsr:@ende/encoding

Version 2026.10.15 on JSR.

Utilities for base58 encoding and decoding.

import { encodeBase58, decodeBase58 } from "@ende/encoding/base58";
import { assertEquals } from "@ende/assert";

const hello = new TextEncoder().encode("Hello World!");

assertEquals(encodeBase58(hello), "2NEpo7TZRRrLZSi2U");

assertEquals(decodeBase58("2NEpo7TZRRrLZSi2U"), hello);

Exports

  • decodeBase58 — Decodes a base58-encoded string.
  • encodeBase58 — Converts data into a base58-encoded string.
  • Uint8Array_ — Proxy type of {@code Uint8Array<ArrayBuffer>} or {@code Uint8Array} in TypeScript 5.7 or below respectively.