Can
Be Better

Javascript Base64相关函数封装

// 使用utf-8字符集进行base64编码
function utoa(str) {
return window.btoa(unescape(encodeURIComponent(str)));
}

// 使用utf-8字符集解析base64字符串
function atou(str) {
return decodeURIComponent(escape(window.atob(str)));
}
赞(0) 打赏
不开启评论,如有问题疑问请发邮件。[email protected]最长的路 » Javascript Base64相关函数封装
分享到: 更多 (0)