You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
420 B
16 lines
420 B
import window from 'global/window';
|
|
|
|
var atob = function atob(s) {
|
|
return window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary');
|
|
};
|
|
|
|
export default function decodeB64ToUint8Array(b64Text) {
|
|
var decodedString = atob(b64Text);
|
|
var array = new Uint8Array(decodedString.length);
|
|
|
|
for (var i = 0; i < decodedString.length; i++) {
|
|
array[i] = decodedString.charCodeAt(i);
|
|
}
|
|
|
|
return array;
|
|
} |