js实现base64编码与解码(原生js)


参考:https://www.cnblogs.com/YMaster/p/9496068.html

前台可以加密两次

针对 IE8 IE9 的兼容使用 polyfill
<!--[if IE]>
<script src="./base64-polyfill.js"></script>
<![endif]-->

// 使用方法
window.btoa(10086)

  

 

后台解密

// 解密js加密的base64
String id = request.getParameter("id");
BASE64Decoder decoder = new BASE64Decoder(); 
byte[] b = decoder.decodeBuffer(id); 
String str=  new String(b);

  

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM