Skip to content

Most Efficient JSON Friendly Byte Encoder ~ JavaScript Base91 Encoding Implementation using a JSON Friendly alphabet (no backward slash and quotes)

License

Notifications You must be signed in to change notification settings

x-currency/xbase91

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xbase91: Most Efficient JSON Friendly Byte Encoder

JavaScript Base91 Encoding Implementation using a JSON Friendly alphabet (no backward slash and quotes)

Usage

import {encode,decode,decodeStr} from '@x-currency/xbase91';

// .encode accepts both bytes (Uint8Array) and string
console.log( 'encode', encode( Uint8Array.from([0,1,2]) ) ); // :CQA
console.log( 'encode' ,encode( 'Hello World!') ); // >OwJh>Io0Tv!8PE

// .decode output bytes (Uint8Array) 
console.log( 'decode', decode(':CQA') ); // Uint8Array(3) [ 0,1,2 ]

// .decodeStr output string 
console.log( 'decodeStr', decodeStr('>OwJh>Io0Tv!8PE') ); // Hello World!

Usage in ES5

const { encode, decode, decodeStr } = require('@x-currency/xbase91');
// same as above

Install

npm install @x-currency/xbase91 --save

Test

node test/example.js

X Currency?

https://www.reddit.com/r/xcurrencyecosystem

About

Most Efficient JSON Friendly Byte Encoder ~ JavaScript Base91 Encoding Implementation using a JSON Friendly alphabet (no backward slash and quotes)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published