lib/utils/byte-utils.js
function base64ToBytes(str) {
    if (typeof atob === 'undefined' && typeof Buffer === 'function') {
        // node.js doesn't have atob
        var buffer = Buffer.from(str, 'base64');
        return new Uint8Array(buffer);
    }
    var byteStr = atob(str);
    var arr = new Uint8Array(byteStr.length);
    for (var i = 0; i < byteStr.length; i++) {
        arr[i] = byteStr.charCodeAt(i);
    }
    return arr;
}
function base64ToBytes(str) {
    if (typeof atob === 'undefined' && typeof Buffer === 'function') {
        // node.js doesn't have atob
        var buffer = Buffer.from(str, 'base64');
        return new Uint8Array(buffer);
    }
    var byteStr = atob(str);
    var arr = new Uint8Array(byteStr.length);
    for (var i = 0; i < byteStr.length; i++) {
        arr[i] = byteStr.charCodeAt(i);
    }
    return arr;
}
function base64ToBytes ( str ) { if ( typeof atob === 'undefined' && typeof Buffer === 'function' ) { // node.js doesn't have atob var buffer = Buffer . from ( str , 'base64' ) ; return new Uint8Array ( buffer ) ; } var byteStr = atob ( str ) ; var arr = new Uint8Array ( byteStr . length ) ; for ( var i = 0 ; i < byteStr . length ; i ++ ) { arr [ i ] = byteStr . charCodeAt ( i ) ; } return arr ; }
Converts base64 string to array
@param {string} str
@return {Uint8Array}
Converts base64 string to array