ignore crypto in the browser
This commit is contained in:
parent
b1741bfdae
commit
48081c6896
@ -14,6 +14,9 @@
|
||||
"browserify": "^14.1.0",
|
||||
"sodium-test": "^0.7.0"
|
||||
},
|
||||
"browser": {
|
||||
"crypto": false
|
||||
},
|
||||
"scripts": {
|
||||
"browser": "browserify test.js | browser-run",
|
||||
"browser-manual": "browserify test.js | browser-run -p 1234",
|
||||
|
@ -21,7 +21,7 @@ var randombytes = (function () {
|
||||
return browserBytes
|
||||
} else if (typeof require !== 'undefined') {
|
||||
// Node.js.
|
||||
crypto = require('cry' + 'pto');
|
||||
crypto = require('crypto')
|
||||
if (crypto && crypto.randomBytes) {
|
||||
return nodeBytes
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user