address

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBase58

func ToBase58(b *Base58) string

ToBase58 prepends a version byte and appends a four byte checksum.

func ToBech32

func ToBech32(bc *Bech32) (string, error)

ToBech32 encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits

Types

type Address

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

Address defines the address as string

type Base58

type Base58 struct {
	Version byte
	Data    []byte
}

Base58 type defines the structure of an address legacy or wrapped segwit

func FromBase58

func FromBase58(address string) (*Base58, error)

FromBase58 decodes a string that was base58 encoded and verifies the checksum.

type Bech32

type Bech32 struct {
	Prefix  string
	Version byte
	Data    []byte
}

Bech32 defines the structure of an address native segwit

func FromBech32

func FromBech32(address string) (*Bech32, error)

FromBech32 decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.

type Blech32

type Blech32 struct {
	Version   byte
	PublicKey []byte
	Data      []byte
}

Blech32 defines the structure of a confidential address native segwit

Jump to

Keyboard shortcuts

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