mirror of https://github.com/status-im/bip39.git
make it browserify friendly
This commit is contained in:
parent
398c61a9c2
commit
893ee6532a
5
index.js
5
index.js
|
@ -2,6 +2,7 @@ var Crypto = require('crypto-js')
|
|||
var path = require('path')
|
||||
var includeFolder = require('include-folder')
|
||||
var Wordlists = includeFolder(path.join(__dirname, 'wordlists'))
|
||||
var randomBytes = require('crypto').randomBytes
|
||||
|
||||
module.exports = BIP39
|
||||
|
||||
|
@ -31,8 +32,8 @@ BIP39.prototype.entropyToMnemonic = function(entropy){
|
|||
}
|
||||
|
||||
BIP39.prototype.generateMnemonic = function(strength){
|
||||
var strength = strength || 128
|
||||
var entropy = crypto.randomBytes(strength/8).toString('hex')
|
||||
strength = strength || 128
|
||||
var entropy = randomBytes(strength/8).toString('hex')
|
||||
return this.entropyToMnemonic(entropy)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue