bs52
v1.0.1
Published
[](https://www.npmjs.org/package/bs52) [](https://gitlab.com/redpelicans/bs52/pipelines)
Maintainers
Readme
bs52
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 ...