diff options
author | Chris Moore <dooglus@gmail.com> | 2016-03-19 13:39:42 -0700 |
---|---|---|
committer | Chris Moore <dooglus@gmail.com> | 2016-03-19 13:39:42 -0700 |
commit | 7772c641c7f2537246ff268bee725debe52edfd9 (patch) | |
tree | 17cbc4c78e7e6cd63f1c21baf4b3eee6beddbc00 /src | |
parent | 18531979e830c8c094e8de0b3ee593eebd250807 (diff) | |
download | BIP39-7772c641c7f2537246ff268bee725debe52edfd9.tar.gz BIP39-7772c641c7f2537246ff268bee725debe52edfd9.tar.zst BIP39-7772c641c7f2537246ff268bee725debe52edfd9.zip |
Normalize whitespace before using mnemonic. Fixes #19.
Diffstat (limited to 'src')
-rw-r--r-- | src/js/jsbip39.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js index 257d8d7..455615a 100644 --- a/src/js/jsbip39.js +++ b/src/js/jsbip39.js | |||
@@ -130,7 +130,7 @@ 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.normalizeString(mnemonic) | 133 | mnemonic = self.normalizeString(mnemonic).split(' ').filter(function(x) { return x.length; }).join(' '); |
134 | passphrase = self.normalizeString(passphrase) | 134 | passphrase = self.normalizeString(passphrase) |
135 | passphrase = "mnemonic" + passphrase; | 135 | passphrase = "mnemonic" + passphrase; |
136 | var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonic); | 136 | var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonic); |