Skip to content

Commit

Permalink
index: rename mnemonicToSeed to mnemonicToSeedHex
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 17, 2014
1 parent 713e5c1 commit 8272cb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var secureRandom = require('secure-random')

var DEFAULT_WORDLIST = require('./wordlists/en.json')

function mnemonicToSeed(mnemonic, password) {
function mnemonicToSeedHex(mnemonic, password) {
var options = { iterations: 2048, hasher: CryptoJS.algo.SHA512, keySize: 512/32 }
return CryptoJS.PBKDF2(mnemonic, salt(password), options).toString(CryptoJS.enc.Hex)
}
Expand Down Expand Up @@ -102,7 +102,7 @@ function lpad(str, padString, length) {
}

module.exports = {
mnemonicToSeed: mnemonicToSeed,
mnemonicToSeedHex: mnemonicToSeedHex,
entropyToMnemonic: entropyToMnemonic,
generateMnemonic: generateMnemonic,
validateMnemonic: validateMnemonic
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ var wordlists = {
var vectors = require('./vectors.json')

describe('BIP39', function() {
describe('mnemonicToSeed', function() {
describe('mnemonicToSeedHex', function() {
this.timeout(20000)

vectors.english.forEach(function(v, i) {
it('works for tests vector ' + i, function() {
assert.equal(BIP39.mnemonicToSeed(v[1], 'TREZOR'), v[2])
assert.equal(BIP39.mnemonicToSeedHex(v[1], 'TREZOR'), v[2])
})
})
})
Expand Down

0 comments on commit 8272cb6

Please sign in to comment.