lib/crypto/random.js
function getBytes(len) {
    if (!len) {
        return new Uint8Array(0);
    }
    algo.getBytes(Math.round(Math.random() * len) + 1);
    var result = algo.getBytes(len);
    var cryptoBytes = CryptoEngine.random(len);
    for (var i = cryptoBytes.length - 1; i >= 0; --i) {
        result[i] ^= cryptoBytes[i];
    }
    return result;
}
function getBytes(len) {
    if (!len) {
        return new Uint8Array(0);
    }
    algo.getBytes(Math.round(Math.random() * len) + 1);
    var result = algo.getBytes(len);
    var cryptoBytes = CryptoEngine.random(len);
    for (var i = cryptoBytes.length - 1; i >= 0; --i) {
        result[i] ^= cryptoBytes[i];
    }
    return result;
}
function getBytes ( len ) { if ( ! len ) { return new Uint8Array ( 0 ) ; } algo . getBytes ( Math . round ( Math . random ( ) * len ) + 1 ) ; var result = algo . getBytes ( len ) ; var cryptoBytes = CryptoEngine . random ( len ) ; for ( var i = cryptoBytes . length - 1 ; i >= 0 ; -- i ) { result [ i ] ^= cryptoBytes [ i ] ; } return result ; }
Gets random bytes
@param {number} len - bytes count
@return {Uint8Array} - random bytes
Gets random bytes