https://github.com/oplik0/base91-deno
more space efficient encoding than base64
https://github.com/oplik0/base91-deno
base91 decoder decoding deno encoder encoding javascript text-encoding typescript
Last synced: 12 months ago
JSON representation
more space efficient encoding than base64
- Host: GitHub
- URL: https://github.com/oplik0/base91-deno
- Owner: oplik0
- License: mit
- Created: 2020-06-25T17:08:41.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-01T15:06:39.000Z (almost 2 years ago)
- Last Synced: 2025-01-06T13:37:52.320Z (about 1 year ago)
- Topics: base91, decoder, decoding, deno, encoder, encoding, javascript, text-encoding, typescript
- Language: TypeScript
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base91-deno
more space efficient encoding than base64
[](https://github.com/oplik0/base91-deno/actions)
## Getting started
Encoding:
```ts
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:
```ts
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:
```bash
deno test
```
This project is using Deno built-in formatter. You can format your code using:
```bash
deno fmt
```
Or ensure it's following its rules with:
```bash
deno fmt --check
```