mnemonic

package module
v0.0.0-...-2454212 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

CS = ENT / 32 MS = (ENT + CS) / 11 the initial entropy length (ENT) mnemonic sentence (MS) checksum bits length (CS) | ENT | CS | ENT+CS | MS | +-------+----+--------+------+ | 128 | 4 | 132 | 12 | | 160 | 5 | 165 | 15 | | 192 | 6 | 198 | 18 | | 224 | 7 | 231 | 21 | | 256 | 8 | 264 | 24 |

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSeed

func NewSeed(mnecmonic, passphrase string) []byte

NewSeed Based on a code (word list) returns the seed (hex bytes)

Types

type DictLang

type DictLang int
const (
	English DictLang = iota
	ChineseSimplified
	ChineseTraditional
	French
	Italian
	Japanese
	Spanish
)

func (DictLang) String

func (dict DictLang) String() string

type Mnemonic

type Mnemonic struct {
	Language DictLang
	WordList WordListInterface
	// contains filtered or unexported fields
}

func NewMnemonic

func NewMnemonic(lang DictLang) (*Mnemonic, error)

func (*Mnemonic) CreateRandom

func (m *Mnemonic) CreateRandom(wordLen int, passpharse string) (*Mnemonic, error)

func (*Mnemonic) FromEntropy

func (m *Mnemonic) FromEntropy(ent []byte, passpharse string) (*Mnemonic, error)

func (*Mnemonic) FromMnemonic

func (m *Mnemonic) FromMnemonic(mnemonic string, passpharse string) (*Mnemonic, error)

func (*Mnemonic) IsValid

func (m *Mnemonic) IsValid(mnemonic string) bool

func (*Mnemonic) Mnemonic

func (m *Mnemonic) Mnemonic() string

func (*Mnemonic) Passpharse

func (m *Mnemonic) Passpharse() string

func (*Mnemonic) Seed

func (m *Mnemonic) Seed() []byte

type WordListInterface

type WordListInterface interface {
	PickIndex(index int64) string
	SeekWord(word string) (int, bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL