u
This commit is contained in:
2
index.js
2
index.js
@@ -59,7 +59,7 @@ module.exports = {
|
||||
// return false
|
||||
|
||||
//// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword)
|
||||
if (typeof secword==='string' && 12===secword.split(/ +/).length) {
|
||||
if (typeof secword==='string' && !/(^\s)|\s\s|(\s$)/.test(secword) && 12===secword.split(/\s+/).length) {
|
||||
for (let lang of Object.keys(bip39.wordlists)) {
|
||||
bip39.setDefaultWordlist(lang)
|
||||
if (bip39.validateMnemonic(secword))
|
||||
|
||||
Reference in New Issue
Block a user