Encode/decode base64 data into ArrayBuffers.
This is a component.js port of Niklas von Hertzen's original version on npm.
$ component install publicclass/base64-arraybuffer
Encodes ArrayBuffer into a base64 string.
Decodes base64 string to ArrayBuffer.
var base64 = require('base64-arraybuffer');
var buf = new Uint8Array(4);
buf[0] = 1;
buf[1] = 2;
buf[2] = 3;
buf[3] = 4;
base64.encode(buf)
//= 'AQIDBA=='
base64.decode('AQIDBA==')
//= ArrayBuffer(4)
MIT