Replace secure-random with crypto.randomBytes

https://github.com/dominictarr/crypto-browserify/pull/45
This commit is contained in:
Wei Lu 2014-08-17 10:32:17 +08:00
parent 0f053f7795
commit ec3f4e16b2
2 changed files with 2 additions and 4 deletions

View File

@ -1,7 +1,6 @@
var assert = require('assert')
var CryptoJS = require('crypto-js')
var crypto = require('crypto')
var secureRandom = require('secure-random')
var DEFAULT_WORDLIST = require('./wordlists/en.json')
@ -66,7 +65,7 @@ function entropyToMnemonic(entropy, wordlist) {
function generateMnemonic(strength, rng, wordlist) {
strength = strength || 128
rng = rng || secureRandom.randomBuffer
rng = rng || crypto.randomBytes
var hex = rng(strength / 8).toString('hex')
return entropyToMnemonic(hex, wordlist)

View File

@ -14,8 +14,7 @@
},
"license": "ISC",
"dependencies": {
"crypto-js": "^3.1.2-2",
"secure-random": "1.0.0"
"crypto-js": "^3.1.2-2"
},
"devDependencies": {
"browserify": "^5.9.1",