From a817ccdcb909aebaeacfdea055de748e703e27de Mon Sep 17 00:00:00 2001 From: yukirij Date: Sun, 1 Sep 2024 15:25:56 -0700 Subject: [PATCH] Change base64 slash to minus. --- www/js/util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/js/util.js b/www/js/util.js index bd2278e..dadeb99 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -31,7 +31,9 @@ const PACK = { for(let i = 0; i < bytes.length; ++i) { str += String.fromCharCode(bytes[i]); } - return window.btoa(str); + let enc = window.btoa(str); + enc.replace("/", "-"); + return enc; }, }; @@ -129,6 +131,7 @@ const UNPACK = { return str; }, base64(data) { + data.replace("-", "/"); let str = window.atob(data); let bytes = new Uint8Array(str.length); for(let i = 0; i < bytes.length; ++i) {