Change base64 slash to minus.

This commit is contained in:
yukirij 2024-09-01 15:25:56 -07:00
parent 1349268a80
commit a817ccdcb9

View File

@ -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) {