Right now it just deals with encoding integers to an arbitrary base.
Ported from a 2013 repository.
FULL DISCLOSURE: It's pretty unreliable due to rounding errors.
Error Example:
var b = require("./base_encode");
var M1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ ";
var mystring = "hello world";
b.encode(b.decode(mystring, M1), M1);
// => 'hello worpn'
var b = require("./base_encode");
console.log(b.encode(777));
// => "NV"
console.log(b.decode("NV"));
// => 777
var b = require("./base_encode");
var hex = "0123456789ABCDEF";
var binary = "01";
console.log(b.encode(255, hex));
// => "FF"
console.log(b.decode("FF", hex));
// => 255
console.log(b.convert("FF", hex, binary));
// => 11111111
var b = require("./base_encode");
var mybase = "asdf123";
console.log(b.encode(1981, mybase));
// => "22fa"
console.log(b.decode("22fa", mybase));
// => 1981