tyler-smith / go-bip39

The BIP39 library for Go.
MIT License
555 stars 196 forks source link

Remove reliance on a package-level wordlist #12

Open tyler-smith opened 6 years ago

tyler-smith commented 6 years ago

Currently there are package level variables holding the wordlist to use. This is not ideal because it makes using the library with multiple languages difficult.

I've started an attempt at a v2 of this lib that creates an Encoder type that encapsulates the wordlist. Encoders for each built-in language are provided. Package-root level functions that proxy to the English Encoder are provided.

https://github.com/tyler-smith/go-bip39/tree/TS_v2

Please give feedback/thoughts on this approach.

gz-c commented 5 years ago

The approach looks good, was there anything you were unsure on?