Bust crypto in browserify

This commit is contained in:
Emil Bay 2020-06-24 13:37:16 +02:00
parent 4bb40aa43d
commit e77c70ef71

View File

@ -18,12 +18,12 @@ var randombytes = (function () {
throw new Error('No secure random number generator available') throw new Error('No secure random number generator available')
} }
crypto = require('crypto')
if (crypto && crypto.getRandomValues) return browserBytes if (crypto && crypto.getRandomValues) return browserBytes
if (require != null) { if (require != null) {
// Node.js. Bust Browserify // Node.js. Bust Browserify
crypto = require('cry' + 'pto') crypto = require('cry' + 'pto')
if (crypto && crypto.randomBytes) return nodeBytes
} }
return noImpl return noImpl