Documentation
¶
Index ¶
- Constants
- func New(length int, language string) (string, error)
- func NewFromEntropy(entropy []byte, language string) (string, error)
- func NewFromFields(fields []string) string
- func Prompt(w io.Writer) error
- func Read(r io.Reader) (string, error)
- func SetLanguage(language string) error
- func Tidy(mnemonic string) string
- func Translate(mnemonic, fromLanguage, toLanguage string) (string, error)
- func Validate(mnemonic string, language ...string) error
Constants ¶
const ( LanguageEnglish = "English" LanguageJapanese = "Japanese" LanguageChineseSimplified = "ChineseSimplified" LanguageChineseTraditional = "ChineseTraditional" LanguageCzech = "Czech" LanguageFrench = "French" LanguageItalian = "Italian" LanguageKorean = "Korean" LanguageSpanish = "Spanish" )
Variables ¶
This section is empty.
Functions ¶
func NewFromEntropy ¶
NewFromEntropy generates new mnemonic sequence from a valid length of entropy bytes. Valid lengths are 16, 20, 24, 28, 32.
func NewFromFields ¶
NewFromFields generates a new mnemonic sentence using input fields
func Read ¶
Read reads a new mnemonic from input. It splits input into fields and then recombines them to ensure that the mnemonic is not affected by extra whitespaces and/or trailing newline char
func SetLanguage ¶
SetLanguage sets language for mnemonic generation and validation
func Tidy ¶
Tidy ensures that the mnemonic sentence does not have extra white spaces or trailing newlines. Since mnemonic sentence is used in cryptographic seed generation it is necessary to make sure that same seed is generated if the fields are the same irrespective of spacing between them
Types ¶
This section is empty.