mirror of https://github.com/status-im/bip39.git
Replace secure-random with crypto.randomBytes
https://github.com/dominictarr/crypto-browserify/pull/45
This commit is contained in:
parent
0f053f7795
commit
ec3f4e16b2
3
index.js
3
index.js
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue