看论坛上总是有人发乱七八糟的文字,根本看不懂,用下面的方法解密一下.

只要有浏览器的开发者工具就行了.

UTF-16解码

console.log("\u5475\u5475")

 

URL解码(在ES6中被标记为Draft)

unescape("%u5475%u5475")

 

Base64解码

decodeURIComponent(escape(atob( "5ZG15ZG1=" )));

 

使用函数:

function utf8_to_b64( str ) {
  return window.btoa(unescape(encodeURIComponent( str )));
}

function b64_to_utf8( str ) {
  return decodeURIComponent(escape(window.atob( str )));
}

 

base64加解码库:

https://github.com/dankogai/js-base64

加解码说明:

https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding

相关文章:

  • 2022-12-23
  • 2022-02-17
  • 2021-12-21
  • 2021-10-30
  • 2021-11-27
  • 2022-01-07
  • 2021-07-18
  • 2021-08-24
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案