jQuery plugin base64 encode and decode
Reload page to: English – 简体中文 – 繁體中文
Summary
Demo
Download
- jQuery plugin base64 [v1.1 build 20110323 - 873.5 kB - 5765 Hits]
- Bug fixed. When user input an empty sting, it will generate a empty string now.
- NOTE: The unicode library is only support chinese. - Or you can get this code from jQuery.com
Usage
Whether or not to use UNICODE library:
$.base64.is_unicode = false/true;
Encode:
$.base64.encode('$.base64');
Decode:
$.base64.decode('JC5iYXNlNjQ=');

十月 11th, 2008 at 01:35
It’s so great,I like it,too match
二月 20th, 2009 at 12:51
[...] Demo http://hpyer.cn/codes/jquery-plugin-base64-encode-and-decode [...]
一月 28th, 2011 at 10:22
[...] This post was mentioned on Twitter by Phelipe Rost and Marcelo Fraga, Rafael C. Oliveira. Rafael C. Oliveira said: jQuery plugin base64 encode and decode – http://migre.me/3Lgh5 #jquery [...]
二月 2nd, 2011 at 19:23
[...] Site Oficial do Projeto [...]
二月 27th, 2011 at 13:44
Hi,
I like this library a lot – whatever algorithm it uses for base64 encode and decode match with the PHP server-side version, and that is not true of the webtoolkit javascript library (which is the current google top hit for a javascript base64 encoder).
Great work, and thank you,
- Kris.
三月 16th, 2011 at 19:14
Hi
I’ve found a problem, which seems not being reported earlier.
In case encode has an empty sting as input (for example an empty input field), it will generate a none empty string. However in PHP, encoding of an empty string, return an empty string.
The main reason is that the code use a do while loop, which means it will always be run once, just by using a while, it will not be encoded, which should be the case.
Check also issue http://www.codingforums.com/showthread.php?t=196237
Currently i’ve made my own workaround.
- Broer
四月 27th, 2011 at 17:30
Hi,
I used this library. I can encode a text but when i failed to encode a picture: .
in my script: function encode () { alert ($.base64.encode(‘here, i must put my picture’));
I didn’t found how introduce my micture in this script.
Any one help me??
四月 29th, 2011 at 20:35
@monia:
Sorry, you can’t encode picture with this library. It’s can only encode text.
三月 13th, 2012 at 14:42
bug for “測試” string