aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-03-03 08:20:17 +1100
committerIan Coleman <coleman.ian@gmail.com>2017-03-03 08:20:17 +1100
commit599fb39e4e775c4f972ecfa3a9c4548177c23183 (patch)
tree8dcae0401c665e0b6c1a27a3f21963bc6bccf48f /src/js
parente6f08c6a6dbad7eaf07f5ccda777ba71fb298038 (diff)
downloadBIP39-599fb39e4e775c4f972ecfa3a9c4548177c23183.tar.gz
BIP39-599fb39e4e775c4f972ecfa3a9c4548177c23183.tar.zst
BIP39-599fb39e4e775c4f972ecfa3a9c4548177c23183.zip
jsbip39 updated - fixes Japanese language
Diffstat (limited to 'src/js')
-rw-r--r--src/js/jsbip39.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js
index 67ba5a7..025f625 100644
--- a/src/js/jsbip39.js
+++ b/src/js/jsbip39.js
@@ -130,10 +130,11 @@ var Mnemonic = function(language) {
130 130
131 self.toSeed = function(mnemonic, passphrase) { 131 self.toSeed = function(mnemonic, passphrase) {
132 passphrase = passphrase || ''; 132 passphrase = passphrase || '';
133 mnemonic = self.joinWords(self.splitWords(self.normalizeString(mnemonic))); // removes blanks 133 mnemonic = self.joinWords(self.splitWords(mnemonic)); // removes duplicate blanks
134 var mnemonicNormalized = self.normalizeString(mnemonic);
134 passphrase = self.normalizeString(passphrase) 135 passphrase = self.normalizeString(passphrase)
135 passphrase = "mnemonic" + passphrase; 136 passphrase = "mnemonic" + passphrase;
136 var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonic); 137 var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonicNormalized);
137 var passphraseBits = sjcl.codec.utf8String.toBits(passphrase); 138 var passphraseBits = sjcl.codec.utf8String.toBits(passphrase);
138 var result = sjcl.misc.pbkdf2(mnemonicBits, passphraseBits, PBKDF2_ROUNDS, 512, hmacSHA512); 139 var result = sjcl.misc.pbkdf2(mnemonicBits, passphraseBits, PBKDF2_ROUNDS, 512, hmacSHA512);
139 var hashHex = sjcl.codec.hex.fromBits(result); 140 var hashHex = sjcl.codec.hex.fromBits(result);