mirror of https://github.com/status-im/bip39.git
index: use createHash/pbkdf2 directly
This commit is contained in:
parent
1fc0b204ac
commit
ff287164d1
6
index.js
6
index.js
|
@ -1,6 +1,6 @@
|
|||
var assert = require('assert')
|
||||
var crypto = require('crypto')
|
||||
var pbkdf2 = require('pbkdf2-compat').pbkdf2Sync
|
||||
var createHash = require('create-hash')
|
||||
var pbkdf2 = require('pbkdf2').pbkdf2Sync
|
||||
var randomBytes = require('randombytes')
|
||||
var unorm = require('unorm')
|
||||
|
||||
|
@ -87,7 +87,7 @@ function validateMnemonic(mnemonic, wordlist) {
|
|||
}
|
||||
|
||||
function checksumBits(entropyBuffer) {
|
||||
var hash = crypto.createHash('sha256').update(entropyBuffer).digest()
|
||||
var hash = createHash('sha256').update(entropyBuffer).digest()
|
||||
|
||||
// Calculated constants from BIP39
|
||||
var ENT = entropyBuffer.length * 8
|
||||
|
|
|
@ -21,13 +21,14 @@
|
|||
},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"pbkdf2-compat": "^2.0.1",
|
||||
"create-hash": "^1.1.0",
|
||||
"pbkdf2": "^3.0.0",
|
||||
"randombytes": "^2.0.1",
|
||||
"unorm": "^1.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^8.0.3",
|
||||
"mocha": "^2.1.0",
|
||||
"browserify": "^9.0.0",
|
||||
"mocha": "^2.2.0",
|
||||
"sinon": "^1.12.2"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue