nodejs base64编码/解码
2016-04-26 11:59
519 查看
e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function aaa(r) { var o = String(r).replace(/=+$/, ""); if (o.length % 4 == 1)throw new t("'atob' failed: The string to be decoded is not correctly encoded."); for (var n, a, i = 0, c = 0, d = ""; a = o.charAt(c++); ~a && (n = i % 4 ? 64 * n + a : a, i++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0)a = e.indexOf(a); return d } function bbb(r) { for (var o, n, a = String(r), i = 0, c = e, d = ""; a.charAt(0 | i) || (c = "=", i % 1); d += c.charAt(63 & o >> 8 - i % 1 * 8)) { if (n = a.charCodeAt(i += .75), n > 255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); o = o << 8 | n } return d }
相关文章推荐
- hadoop namenode启动不了解决方案
- node.js小结
- node express 初级
- node 项目初始化
- node express创建项目
- 19. Remove Nth Node From End of List
- Windows 系统下设置Nodejs NPM全局路径
- Nodejs笔记(三)
- leetcode-24. Swap Nodes in Pairs
- nodejs原理
- Hadoop学习(三)— hdfs : NameNode与DataNode的实现机制
- LeetCode------Delete Node in a Linked List
- nodejs完整登陆交互
- LeeCode-Swap Nodes in Pairs
- LeeCode-Delete Node in a Linked List
- 解决NameNode配置HA后Hive路径不正确的问题
- node.js 模板 ejs
- 利用Node.js流和事件处理文本文件
- node.js cluster多进程、负载均衡和平滑重启
- web编程速度大比拼(nodejs go python)(非专业对比)