block by aemkei 989006

140byt.es - Base64 encoder

140byt.es - Base64 Encoder

A simple base64 encoder. Simply pass your string and a reference to the function to get back the encoded string.

Example

var 
  map ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  sample = "140bytes rocks!",
  encoded = base64Encode(sample, map);

Acknowledgment

Artur Honzawa @arturhonzawa hacked the main code and further compression was done by me (@aemkei). Thanks to Rob Griffiths @bytespider and Jed Schmidt @jedschmidt for some pretty good hints!

Issues

Feel free to fork and improve!

index.js

LICENSE.txt

annotated.js

package.json