atob btoa 加解密

atob(arg) 对arg进行解密
atob(str) 对str进行加密


1、兼容性:

2、注意:
我这次加密的时id字符串,其中只包含字母和数字;
加密方法中的参数,只能包含: 数字,大小写字母,应文标点符号,具体字符集是: latin1字符集;可自行百度查看其涵盖哪些字符;
如果str中包含中文,中文字符等不能识别的,就会报错DOMException: The string to be encoded contains characters outside of the Latin1 range.

posted @ 2023-09-22 14:13  Math点PI  阅读(252)  评论(0)    收藏  举报