node-bignum icon indicating copy to clipboard operation
node-bignum copied to clipboard

Support base32 and base64

Open tracker1 opened this issue 10 years ago • 0 comments

It would be very nice if this module supported base32 and base64... where base64 is fairly common, Crockford's Base32 is a much better representation for numbers being telephone friendly...

Thanks.

for base32 - b32 module

b32.encodeSync(bignum('500',10).toBuffer()) // 'AH2A'
bignum.fromBuffer(b32.decodeSync('AH2A')) // <BigNum 500>

for base64 - base64-js module

var b64 = require('base64-js');
b64.fromByteArray(bignum('500',10).toBuffer()) // 'AfQ='
bignum.fromBuffer(new Buffer(b64.toByteArray('AfQ='))) // <BigNum 500>

tracker1 avatar Apr 01 '15 20:04 tracker1