diff options
-rw-r--r-- | bip39-standalone.html | 4 | ||||
-rw-r--r-- | src/js/index.js | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 2888d03..4a18657 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -18648,7 +18648,7 @@ window.Entropy = new (function() { | |||
18648 | // mnemonics is populated as required by getLanguage | 18648 | // mnemonics is populated as required by getLanguage |
18649 | var mnemonics = { "english": new Mnemonic("english") }; | 18649 | var mnemonics = { "english": new Mnemonic("english") }; |
18650 | var mnemonic = mnemonics["english"]; | 18650 | var mnemonic = mnemonics["english"]; |
18651 | var seed = null | 18651 | var seed = null; |
18652 | var bip32RootKey = null; | 18652 | var bip32RootKey = null; |
18653 | var bip32ExtendedKey = null; | 18653 | var bip32ExtendedKey = null; |
18654 | var network = bitcoin.networks.bitcoin; | 18654 | var network = bitcoin.networks.bitcoin; |
@@ -19292,6 +19292,8 @@ window.Entropy = new (function() { | |||
19292 | var closestWord = words[0]; | 19292 | var closestWord = words[0]; |
19293 | for (var i=0; i<words.length; i++) { | 19293 | for (var i=0; i<words.length; i++) { |
19294 | var comparedTo = words[i]; | 19294 | var comparedTo = words[i]; |
19295 | if (comparedTo.indexOf(word) == 0) return comparedTo; | ||
19296 | |||
19295 | var distance = Levenshtein.get(word, comparedTo); | 19297 | var distance = Levenshtein.get(word, comparedTo); |
19296 | if (distance < minDistance) { | 19298 | if (distance < minDistance) { |
19297 | closestWord = comparedTo; | 19299 | closestWord = comparedTo; |
diff --git a/src/js/index.js b/src/js/index.js index 13c6178..af09606 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -3,7 +3,7 @@ | |||
3 | // mnemonics is populated as required by getLanguage | 3 | // mnemonics is populated as required by getLanguage |
4 | var mnemonics = { "english": new Mnemonic("english") }; | 4 | var mnemonics = { "english": new Mnemonic("english") }; |
5 | var mnemonic = mnemonics["english"]; | 5 | var mnemonic = mnemonics["english"]; |
6 | var seed = null | 6 | var seed = null; |
7 | var bip32RootKey = null; | 7 | var bip32RootKey = null; |
8 | var bip32ExtendedKey = null; | 8 | var bip32ExtendedKey = null; |
9 | var network = bitcoin.networks.bitcoin; | 9 | var network = bitcoin.networks.bitcoin; |
@@ -647,6 +647,8 @@ | |||
647 | var closestWord = words[0]; | 647 | var closestWord = words[0]; |
648 | for (var i=0; i<words.length; i++) { | 648 | for (var i=0; i<words.length; i++) { |
649 | var comparedTo = words[i]; | 649 | var comparedTo = words[i]; |
650 | if (comparedTo.indexOf(word) == 0) return comparedTo; | ||
651 | |||
650 | var distance = Levenshtein.get(word, comparedTo); | 652 | var distance = Levenshtein.get(word, comparedTo); |
651 | if (distance < minDistance) { | 653 | if (distance < minDistance) { |
652 | closestWord = comparedTo; | 654 | closestWord = comparedTo; |