Skip to content

Commit

Permalink
Merge pull request #1 from weilu/browserify-skip-crypto
Browse files Browse the repository at this point in the history
Get rid of browserify hack
  • Loading branch information
jprichardson committed Mar 20, 2014
2 parents caf54f2 + bccdbd2 commit 69d05e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/secure-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ function secureRandom(count, options) {
}

function nodeRandom(count, options) {
var req = require //the intent here is to trick browserify
var crypto = req('crypto') //trick browserify, => if we didn't do this, browserify would put crypto pkg in the bundle
var crypto = require('crypto')
var buf = crypto.randomBytes(count)

if (options.array)
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"mocha": "*",
"terst": "0.0.1"
},
"dependencies": {}
}
"dependencies": {},
"browser": {
"crypto": false
}
}

0 comments on commit 69d05e1

Please sign in to comment.