1.0.0 • Published 3 years ago

bs52 v1.0.0

Weekly downloads
4
License
-
Repository
gitlab
Last release
3 years ago

bs52

NPM Package Build Status

Fast base52 strings encoding / decoding using bitcoin style leading zero compression.

bs52 is a rewrite of cryptocoinjs/base-x without Buffer and limited to base52 and strings as input.

Target was to use the library in browsers.

@redpelicans we are using this lib to encode/decode keys using extended chars.

It's limited to below alphabet:

  const ALPHABET = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`;

Example

var bs52 = require('bs52');

var decoded = bs52.encode('Bonjour ici les bidibules')
// sTSzrBprGARdjdZHPiCpfcASBQxaCTEnHmZ

console.log(bs52.decode('sTSzrBprGARdjdZHPiCpfcASBQxaCTEnHmZ'))
// Bonjour ici ...