Base64 Encoder/Decoder

base64.js

What is it

Base64 is a binary data encoding schema. You can find the details in RFC2045, 6.8, "Base64 Content-Transfer-Encoding". This javascript object defines two function : base64.encode and base64.decode. It's too simple to use. So, that's all.

Example

Source

var _encode	= document.getElementById("_encode");
var _decode	= document.getElementById("_decode");
_encode.appendChild(document.createTextNode(base64.encode("Hello World!")));
_decode.appendChild(document.createTextNode(base64.decode(base64.encode("Hello World!"))));

Result

Before Encoding: Hello World!
After Encoding:
After Decoding: