Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checksum ¶
Checksum holds SHA256 hash of the entropy
func (Checksum) ToBitSlice ¶
ToBitSlice will convert the byte slice into an individual bit slice with each element holding one bit
type Language ¶
type Language string
Language type
const ( // English words English Language = "English" // Spanish words Spanish Language = "Spanish" // French words French Language = "French" // Italian words Italian Language = "Italian" // Japanese words Japanese Language = "Japanese" // Korean words Korean Language = "Korean" // ChineseSimple words ChineseSimple Language = "ChineseSimple" // ChineseTraditional words ChineseTraditional Language = "ChineseTraditional" )
type Mnemonics ¶
type Mnemonics []Mnemonic
Mnemonics is a simple wrapper for a string slice
func GenerateMnemonics ¶
func GenerateMnemonics(r RandomEntropy, lang Language) (Mnemonics, error)
GenerateMnemonics will generate the set of mnemonic words (length dependent upon bitsize). An error will be returned if the RandomEntropy or Language are invalid Word Count: 128 = 12 words 160 = 15 words 192 = 18 words 224 = 21 words 256 = 24 words
func (Mnemonics) GenerateSeed ¶
GenerateSeed will create a new Seed to use within a HD wallet
type RandomEntropy ¶
type RandomEntropy []byte
RandomEntropy wraps a random series of bytes
func GenerateRandomEntropy ¶
func GenerateRandomEntropy(bits int) (RandomEntropy, error)
GenerateRandomEntropy will generate a random number of bytes matching the length of bits required. The length of bits must be divisible by 32 or else a corresponding error will be returned.
func (RandomEntropy) GenerateMnemonics ¶
func (r RandomEntropy) GenerateMnemonics(lang Language) (Mnemonics, error)
GenerateMnemonics will return the matching words for the provided entropy The number of words depends on the entropy bit size
func (RandomEntropy) String ¶
func (r RandomEntropy) String() string
String will print the Entropy as a string
func (RandomEntropy) ToHex ¶
func (r RandomEntropy) ToHex() RandomEntropyHex
ToHex will create a HEX string representation
type RandomEntropyHex ¶
type RandomEntropyHex string
RandomEntropyHex will hold a Random hex value
func (RandomEntropyHex) ToRandomEntropy ¶
func (h RandomEntropyHex) ToRandomEntropy() (RandomEntropy, error)
ToRandomEntropy will create the Random entropy from the Hex value
type Seed ¶
type Seed []byte
Seed generated from the mnemonics
func GenerateSeed ¶
GenerateSeed will use the PBKDF2 to generate a hash (using the SHA512 hash) and performing 2048 iterations.