mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-18 08:22:16 +00:00
Test suggested word for first four letters of word
See https://github.com/iancoleman/bip39/pull/48
This commit is contained in:
@@ -19292,8 +19292,9 @@ window.Entropy = new (function() {
|
||||
var closestWord = words[0];
|
||||
for (var i=0; i<words.length; i++) {
|
||||
var comparedTo = words[i];
|
||||
if (comparedTo.indexOf(word) == 0) return comparedTo;
|
||||
|
||||
if (comparedTo.indexOf(word) == 0) {
|
||||
return comparedTo;
|
||||
}
|
||||
var distance = Levenshtein.get(word, comparedTo);
|
||||
if (distance < minDistance) {
|
||||
closestWord = comparedTo;
|
||||
|
||||
Reference in New Issue
Block a user