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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章