This javascript code is used to encode / decode data using base64 (this encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean). Script is fully compatible with UTF-8 encoding. You can use base64 encoded data as simple encryption mechanism.
If you plan using UTF-8 encoding in your project don’t forget to set the page encoding to UTF-8 (Content-Type meta tag).
DEMO
Source code for webtoolkit.base64.js:
转自:http://www.webtoolkit.info/javascript-base64.html
http://www.cnblogs.com/QLeelulu/archive/2009/11/22/1607898.html