new_file.html 426 B

123456789101112131415161718
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <script>
  9. function encodeFunc(str) {
  10. let utf8Bytes = new TextEncoder().encode(str);
  11. let base64Str = btoa(String.fromCharCode(...utf8Bytes));
  12. return base64Str.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
  13. }
  14. encodeFunc('原神启动!')
  15. </script>
  16. </body>
  17. </html>