index: use createHash/pbkdf2 directly

This commit is contained in:
Daniel Cousens 2015-03-18 19:23:26 +11:00
parent 1fc0b204ac
commit ff287164d1
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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"
}
}