Documentation ¶
Overview ¶
Package mnemonic a way of representing a large randomly-generated number as a sequence of words, making it easier for humans to store.
package main import ( "fmt" "github.com/umahmood/mnemonic" ) func main() { m, err := mnemonic.New(mnemonic.DefaultConfig) if err != nil { // ... } words, err := m.Words() if err != nil { // ... } fmt.Println(words) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{
Bits: 128,
Passphrase: "",
}
DefaultConfig to create mnemonics, ideal entropy should be 128 to 256 bits.
View Source
var ErrInvalidBitSize = errors.New("bits must be greater than 0 and multiple of 32")
ErrInvalidBitSize error when bits are not a multiple of 32
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Bits int // Bits entropy to generate, must be a multiple of 32 bits. Passphrase string // Optional passphrase allows you to modify the final seed. }
Config instance
type Mnemonic ¶
type Mnemonic struct {
// contains filtered or unexported fields
}
Mnemonic instance
Click to show internal directories.
Click to hide internal directories.