id

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomKey

func GetRandomKey() []byte

GetRandomKey generates and returns a random key for ID.

Types

type ID

type ID struct {
	// contains filtered or unexported fields
}

ID is host id.

func NewID

func NewID(key []byte) (ID, error)

NewID returns random host id.

func (ID) GetHash

func (id ID) GetHash() []byte

GetHash returns hash of key.

func (ID) HashEqual

func (id ID) HashEqual(other []byte) bool

HashEqual checks if hash is equal to another.

func (ID) HashString

func (id ID) HashString() string

HashString is a base58-encoded string representation hash of public key.

func (ID) KeyEqual

func (id ID) KeyEqual(other []byte) bool

KeyEqual checks if id is equal ot another.

func (ID) KeyString

func (id ID) KeyString() string

KeyString is a base58-encoded string representation of host public key.

func (ID) MarshalBinary

func (id ID) MarshalBinary() ([]byte, error)

MarshalBinary is binary marshaler.

func (*ID) SetHash

func (id *ID) SetHash(newHash []byte)

SetHash sets new hash.

func (*ID) UnmarshalBinary

func (id *ID) UnmarshalBinary(data []byte) error

UnmarshalBinary is binary unmarshaler.

Jump to

Keyboard shortcuts

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