1664
Sort safe base16 to/from base64 conversion with filename and url safe characters written in pure javascript
Install
npm install 1664
Usage
Note: API changed with 0.2.x depreciates base.to16
and base.to64
MD5 example
base = require('1664')
base.to16('z')
base.to64('f')
base16 = base.base16
base64 = base.base64
MD5 = require('MD5')
md5 = MD5('hello')
md564 = base16.to64(md5)
md5b = base64.to16(md564)
md564 = base64.from16(md5)
md5b = base16.from64(md564)
console.log(md5.length, md5)
console.log(md564.length, md564)
console.log('same?', (md5==md5b))
console.log(base64.fromDate('2012-10-18 02:57:49'))
console.log(base64.toDate('2AI2um'))
SHA-512 example
base16 = require('1664').base16
SHA = require('jssha')
shaObj = new SHA("hello", "TEXT")
hash = shaObj.getHash("SHA-512", "HEX")
hash64 = base16.to64(hash)
hashb = base16.from64(hash64)
console.log(hash.length, hash)
console.log(hash64.length, hash64)
console.log('same?', (hash==hashb))
License
MIT