Skip to content

Instantly share code, notes, and snippets.

@liamsi
Created May 21, 2018 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liamsi/b14eec5d6e273c27c95c74a4200ddd37 to your computer and use it in GitHub Desktop.
Save liamsi/b14eec5d6e273c27c95c74a4200ddd37 to your computer and use it in GitHub Desktop.
package main
import (
"encoding/hex"
"fmt"
tyler "github.com/tyler-smith/go-bip39"
bartekn "github.com/bartekn/go-bip39"
)
func main() {
entropy,_ := hex.DecodeString("000CF70C02EA90959B78FB43F683A690")
mne, err := tyler.NewMnemonic(entropy)
fmt.Println(mne)
fmt.Println(err)
b, err := tyler.MnemonicToByteArray(mne)
fmt.Printf("%X \n", b)
fmt.Println(err)
b, err = bartekn.MnemonicToByteArray(mne)
fmt.Printf("%X \n", b)
fmt.Println(err)
}
@liamsi
Copy link
Author

liamsi commented May 21, 2018

Here tyler's lib doesn't do anything and complains (while verifying the checksum):

abandon guilt seek alarm poverty enlist hospital buyer dumb reduce trust candy
<nil>
 
Invalid byte at position 2
000CF70C02EA90959B78FB43F683A690 
<nil>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment