dart-bitcoin / bip39

BSD 3-Clause "New" or "Revised" License
44 stars 72 forks source link

Chinese mnemonic #24

Open jin9393 opened 2 years ago

jin9393 commented 2 years ago

I am currently facing an issue converting Chinese mnemonics to hex. The returned string does not match the intended result. Everything works fine when attempting on English. Thanks in advance.

String plainText = "成 山 何 阀 臣 愈 梅 握 厂 坑 磷 正 熊 紧 簧"; String seedHex = bip39.mnemonicToSeedHex(plainText); // result: f9efae87296519949ddecfb4fecf59beec3a1bb71ecfd3452aa653c5d9d9af9cfe017916a000151527b22ee79a86b0a24836b024696534fa2a8c0ca403540533

// intended result: 41656441c5621160d8d67aa48a99818e1bb0ef9668d20f22b6129662e14a7ad8b8ed2125c66516bbb3bc96ce109cd919a69c60c7263c6eafb1fb9032d6749556

cjango commented 2 years ago

有解决办法么

yancaidev commented 2 years ago

看了源码,不支持中文,试试 bip39_mnemonic 这个库。