Documentation ¶
Overview ¶
package bip39 represents and converts bitcoin bip39 mnemonic phrases.
Index ¶
Constants ¶
View Source
const LongestWord = 8
View Source
const NumWords = Word(len(index))
View Source
const ShortestWord = 3
Variables ¶
View Source
var ErrInvalidChecksum = errors.New("bip39: invalid checksum")
Functions ¶
func MnemonicSeed ¶
Types ¶
type Mnemonic ¶
type Mnemonic []Word
func ParseMnemonic ¶
func (Mnemonic) Entropy ¶
Entropy returns the entropy represented by the mnemonic. It panics if the mnemonic is invalid.
func (Mnemonic) FixChecksum ¶
FixChecksum returns a copy of the mnemonic with a correct checksum. This method defeats the purpose of the bip39 checksum, so it should only be used for generating new mnemonics.
type Word ¶
type Word int
func ChecksumWord ¶
func ClosestWord ¶
func DiceToWord ¶
DiceToWord converts a dice roll to its bip39 word index. It returns false if the roll doesn't have a word defined.
func RandomWord ¶
func RandomWord() Word
Click to show internal directories.
Click to hide internal directories.