Commit 81005e2e authored by Moul's avatar Moul

Consider Uint8Array as a string type

parent 237f27b0
Pipeline #6171 failed with stages
in 1 minute and 24 seconds
......@@ -28,7 +28,7 @@ export const encodeUTF8 = function(arr:any[]) {
export const encodeBase64 = function(arr:Uint8Array) {
if (typeof btoa === 'undefined' || !window) {
return (Buffer.alloc(arr)).toString('base64');
return (Buffer.from(arr)).toString('base64');
} else {
let i, s = [], len = arr.length;
for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment