Skip to content

Instantly share code, notes, and snippets.

@CodeBoy2006
Created May 1, 2020 06:10
Show Gist options
  • Select an option

  • Save CodeBoy2006/958a2ef9614b1ad5649f9e3ddd274325 to your computer and use it in GitHub Desktop.

Select an option

Save CodeBoy2006/958a2ef9614b1ad5649f9e3ddd274325 to your computer and use it in GitHub Desktop.
字符串与BASE64转换,Javascript 中文不报错不乱码
btoa(unescape(encodeURIComponent( string ))) //字符串转BASE64
atob(unescape(encodeURIComponent( string ))) //BASE64转字符串
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment