diff --git a/ticc.js b/ticc.js index 4eee4c4..8886ef7 100644 --- a/ticc.js +++ b/ticc.js @@ -124,9 +124,7 @@ class TicCrypto { // return false //// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword) - secword = secword - .replace(/^\s+/, '') // 删除开头的空格 - .replace(/\s+$/, '') // 删除末尾的空格 + secword = secword.trim() if (typeof secword === 'string' && [12, 15, 18, 21, 24].includes(secword.split(/\s+/).length)) { if (mode === 'easy') return true // easy模式不检查校验等等严格的合法性了,反正 secword_to_seed 是接受一切字符串的 if (my.langMap[lang?.toLowerCase?.()]) {