u
This commit is contained in:
parent
cd37a2b9bb
commit
31384ce340
5
index.js
5
index.js
@ -790,8 +790,9 @@ class TICrypto {
|
|||||||
* @memberof TICrypto
|
* @memberof TICrypto
|
||||||
*/
|
*/
|
||||||
static secword2seed(secword, pass) {
|
static secword2seed(secword, pass) {
|
||||||
// 遵循bip39的算法。和 ether.HDNode.mnemonic2Seed 结果一样,是64字节的种子。其实
|
// 遵循bip39的算法。和 ether.HDNode.mnemonic2Seed 结果一样,是64字节的种子。
|
||||||
return bip39.mnemonicToSeedSync(secword, pass).toString('hex') // 结果一致于 new BitcoreMnemonic(secword).toSeed(pass).toString('hex') 或 ethers.HDNode.mnemonic2Seed(secword)。其实,bip39.mnemonicToSeedSync 也接受不合法的 secword,只要是个string就行。
|
// 注意,bip39.mnemonicToSeedSync 也接受不合法的 secword,只要是个string,或者是 undefined/null/0/''/false(这几个的结果都一样)
|
||||||
|
return bip39.mnemonicToSeedSync(secword, pass).toString('hex') // 结果一致与 new BitcoreMnemonic(secword).toSeed(pass).toString('hex') 或 ethers.HDNode.mnemonic2Seed(secword)。
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user