base45nt
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Base45 NT

A Typescript implementation of the Base45 encoding as described in RFC 9285

Why?

Most Base45 implementations I found used NodeJS Buffer, which is not available in browsers. Also I wanted to try to code my own.

How?

Use the decode and encode functions defined in the library. They turn Uint8Arrays into Base45 encoded strings and vice versa

import { encode, decode } from 'base45nt'

const bytes = new Uint8Array([1, 2, 3])
const base45 = encode(bytes)
console.log(base45) // -> "X5030"
const bytesAgain = decode(base45)
console.log(bytesAgain.toString()) // -> "1,2,3"

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i base45nt

    Weekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    14.3 kB

    Total Files

    9

    Last publish

    Collaborators

    • scezar