function browserEntropy() {
    let entropyStr = Array(randomBytes(101)).join();
    try {
        entropyStr += (new Date()).toString() + " " + window.screen.height + " " + window.screen.width + " " +
            window.screen.colorDepth + " " + " " + window.screen.availHeight + " " + window.screen.availWidth + " " +
            window.screen.pixelDepth + navigator.language + " " + window.location + " " + window.history.length;

        for (let i = 0, mimeType; i < navigator.mimeTypes.length; i++) {
            mimeType = navigator.mimeTypes[i];
            entropyStr += mimeType.description + " " + mimeType.type + " " + mimeType.suffixes + " ";
        }
    } catch(error) {
        //nodejs:ReferenceError: window is not defined
        entropyStr += hash.sha256((new Date()).toString());
    }

    const b = new Buffer(entropyStr);
    entropyStr += b.toString("binary") + " " + (new Date()).toString();

    let entropy = entropyStr;
    const start_t = Date.now();
    while (Date.now() - start_t < 25)
        entropy = hash.sha256(entropy);

    return entropy;
}