Skip to content

Commit 8e7630d

Browse files
committed
Merge branch 'develop'
2 parents f9a6425 + 834aa77 commit 8e7630d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

DupeNukem/Script.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ var __dupeNukem_Messenger__ =
104104
};
105105

106106
this.constructArray__ = arr => {
107-
const base64 = btoa(new TextDecoder().decode(arr));
107+
// https://developer.mozilla.org/en-US/docs/Glossary/Base64
108+
const base64 = btoa(Array.from(arr, byte => String.fromCodePoint(byte)).join(""));
108109
return {
109110
__type__: "byteArray",
110111
__body__: base64
@@ -163,7 +164,8 @@ var __dupeNukem_Messenger__ =
163164
case "byteArray":
164165
if (obj.__body__ !== null) {
165166
const base64 = obj.__body__;
166-
const arr = new TextEncoder().encode(atob(base64));
167+
// https://developer.mozilla.org/en-US/docs/Glossary/Base64
168+
const arr = Uint8Array.from(atob(base64), m => m.codePointAt(0));
167169
return arr.buffer;
168170
} else {
169171
return null;

0 commit comments

Comments
 (0)