用 secword.trim() 取代 secword.replace(/^\s+/, '').replace(/\s+$/, '')
This commit is contained in:
parent
acabbfa787
commit
ced82b18d7
4
ticc.js
4
ticc.js
@ -124,9 +124,7 @@ class TicCrypto {
|
|||||||
// return false
|
// return false
|
||||||
|
|
||||||
//// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword)
|
//// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword)
|
||||||
secword = secword
|
secword = secword.trim()
|
||||||
.replace(/^\s+/, '') // 删除开头的空格
|
|
||||||
.replace(/\s+$/, '') // 删除末尾的空格
|
|
||||||
if (typeof secword === 'string' && [12, 15, 18, 21, 24].includes(secword.split(/\s+/).length)) {
|
if (typeof secword === 'string' && [12, 15, 18, 21, 24].includes(secword.split(/\s+/).length)) {
|
||||||
if (mode === 'easy') return true // easy模式不检查校验等等严格的合法性了,反正 secword_to_seed 是接受一切字符串的
|
if (mode === 'easy') return true // easy模式不检查校验等等严格的合法性了,反正 secword_to_seed 是接受一切字符串的
|
||||||
if (my.langMap[lang?.toLowerCase?.()]) {
|
if (my.langMap[lang?.toLowerCase?.()]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user