1.0.0 • Published 4 years ago
bs62 v1.0.0
bs62
Fast base62 strings encoding / decoding using bitcoin style leading zero compression.
bs62
is a rewrite of cryptocoinjs/base-x without Buffer
and limited to base62 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 = `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`;
Example
var bs62 = require('bs62');
var decoded = bs62.encode('Bonjour ici les bidibules')
// 2XuGb0zE9QdU3OVBUGW1EAUlh2m8TJUioH
console.log(bs72.decode('2XuGb0zE9QdU3OVBUGW1EAUlh2m8TJUioH'))
// Bonjour ici ...