Fix replace handling.

This commit is contained in:
yukirij 2024-09-01 15:35:04 -07:00
parent a817ccdcb9
commit 50851064e7

View File

@ -32,8 +32,7 @@ const PACK = {
str += String.fromCharCode(bytes[i]);
}
let enc = window.btoa(str);
enc.replace("/", "-");
return enc;
return enc.replace("/", "-");
},
};
@ -131,7 +130,7 @@ const UNPACK = {
return str;
},
base64(data) {
data.replace("-", "/");
data = data.replace("-", "/");
let str = window.atob(data);
let bytes = new Uint8Array(str.length);
for(let i = 0; i < bytes.length; ++i) {