File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ var __dupeNukem_Messenger__ =
104
104
} ;
105
105
106
106
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 ( "" ) ) ;
108
109
return {
109
110
__type__ : "byteArray" ,
110
111
__body__ : base64
@@ -163,7 +164,8 @@ var __dupeNukem_Messenger__ =
163
164
case "byteArray" :
164
165
if ( obj . __body__ !== null ) {
165
166
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 ) ) ;
167
169
return arr . buffer ;
168
170
} else {
169
171
return null ;
You can’t perform that action at this time.
0 commit comments