1.base64加密
一個字節一般由8位表示,base64加密就是把8位表示轉為6為表示,余下2位添0表示,故有個特點不能充分利用空間。
資源下載:jquery.js,base64.js
// `utf8encode` - utf8 encoding only (default: `false`) // `utf8decode` - utf8 decoding only (default: `false`) // `raw` - both (default: `true`) $.base64.utf8encode = true; //編碼 var str = $.base64.encode("a"); alert("base64 decode:" + str); //解碼 str = $.base64.decode(str); alert("base64 decode:" + str);
2.md5加密
md5加密是一種不可逆的加密方式,
資源下載:jquery.js,md5.js
var str = $.md5("a"); alert(str);
3.sha1加密
sha1加密方式也是一種不可逆的加密方式,相對來講要比較安全些。
資源下載:jquery.js,sha1.js
var str = $.sha1("a"); alert(str);