diff --git a/README.xlsx b/README.xlsx index 5b04ba4..9cacbee 100644 Binary files a/README.xlsx and b/README.xlsx differ diff --git a/index.js b/index.js index 601f23f..2019637 100644 --- a/index.js +++ b/index.js @@ -60,11 +60,9 @@ module.exports = { //// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword) if (typeof secword==='string' && 12===secword.split(/ +/).length) { - try { - bip39.mnemonicToEntropy(secword) - return true - }catch(exception){ - return false + for (let lang of Object.keys(bip39.wordlists)) { + if (bip39.validateMnemonic(secword)) + return true } } return false