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

base91-deno

more space efficient encoding than base64

Deno CI

Getting started

Encoding:

import { encode } from "https://deno.land/x/base91@v1.1.1/base91.ts";
const encoder = new TextEncoder(); //converts utf-8 string to Uint8Array
const input = encoder.encode("test"); //Uint8Array(4) [ 116, 101, 115, 116 ]
const result = encode(input); //"fPNKd"

Decoding:

import { decode } from "https://deno.land/x/base91@v1.1.1/base91.ts";
const decoder = new TextDecoder("utf-8"); //used to convert Uint8Array to utf-8 string
const result = decode("fPNKd"); //Uint8Array(4) [ 116, 101, 115, 116 ]
const output = decoder.decode(result); //"test"

Development

Run tests:

deno test

This project is using Deno built-in formatter. You can format your code using:

deno fmt

Or ensure it’s following its rules with:

deno fmt --check