javaScript 加解密方法

base64加密

<html>
<head>
<title>前端的base64使用方法</title>
</head>
<body>
</body>
<script>
var str = "hello";
var str64 = window.btoa("hello");
console.log("字符串是:"+str);
console.log("经base64编码后:"+str64);
console.log("base64解码后:"+window.atob(str64));
</script>
</html>

转自:https://www.jianshu.com/p/4c236d83ea04

点赞