iotxaddress

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidVersion is returned when invalid version has been detected.
	ErrInvalidVersion = errors.New("invalid version")
	// ErrInvalidChainID is returned when invalid chain ID has been detected.
	ErrInvalidChainID = errors.New("invalid chain ID")
)

Functions

func GetAddress

func GetAddress(pub []byte, isTestnet bool, version byte, chainid []byte) (string, error)

GetAddress returns the address given a public key and necessary params.

func GetPubkeyHash

func GetPubkeyHash(address string) []byte

GetPubkeyHash extracts public key hash from address

func HashPubKey

func HashPubKey(pubKey []byte) []byte

HashPubKey returns the hash of public key

func ValidateAddress

func ValidateAddress(address string) bool

ValidateAddress check if address if valid.

Types

type Address

type Address struct {
	PrivateKey []byte
	PublicKey  []byte
	Address    string
}

Address contains a pair of key and a string address

func NewAddress

func NewAddress(isTestnet bool, version byte, chainid []byte) (*Address, error)

NewAddress returns a newly created public/private key pair together with the address derived.

Directories

Path Synopsis
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader.
Package bech32 includes a Bech32 string which is at most 90 characters long and consists of: The human-readable part, which is intended to convey the type of data, or anything else that is relevant to the reader.

Jump to

Keyboard shortcuts

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