Bust crypto in browserify
This commit is contained in:
parent
4bb40aa43d
commit
e77c70ef71
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user