201014-Js base64编解码

Js使用base64编解码主要借助btoaatob两个方法,但使用时需要注意,它们并不支持非ascii码转码

1
2
3
4
5
> b = btoa("hello world")
< "aGVsbG8gd29ybGQ="

> atob(b)
<"hello world"
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×