common

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrDefaultVersion = 0
)

Variables

View Source
var (
	AddrCheckSumLen = 4
)

Functions

func B58Decode

func B58Decode(enc []byte) []byte

func B58Encode

func B58Encode(data []byte) []byte

func BytesMixed

func BytesMixed(src []byte, lenBits int, buffer *bytes.Buffer) error

func Decode16Byte

func Decode16Byte(str string) []byte

func Encode16Byte

func Encode16Byte(byteVal []byte) string

func Hex2bytes

func Hex2bytes(s string) []byte

func IsZeroHash

func IsZeroHash(h Hash) bool

func ReadMixedBytes

func ReadMixedBytes(buf *bytes.Buffer) ([]byte, error)

Types

type Address

type Address [addrLen]byte

func B58ToAddress

func B58ToAddress(enc []byte) Address

func Bytes2Address

func Bytes2Address(b []byte) Address

func Hex2Address

func Hex2Address(s string) Address

func StrB58ToAddress

func StrB58ToAddress(enc string) Address

func (*Address) B58

func (a *Address) B58() []byte

func (*Address) B58String

func (a *Address) B58String() string

func (*Address) Bytes

func (a *Address) Bytes() []byte

func (*Address) Checksum

func (a *Address) Checksum() []byte

func (*Address) Equals

func (a *Address) Equals(b Address) bool

func (*Address) Hex

func (a *Address) Hex() string

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

func (*Address) Payload

func (a *Address) Payload() []byte

func (*Address) PubKeyHash

func (a *Address) PubKeyHash() []byte

func (*Address) SetBytes

func (a *Address) SetBytes(b []byte)

func (*Address) String

func (a *Address) String() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(data []byte) error

func (*Address) Version

func (a *Address) Version() uint8

type Hash

type Hash [hashLen]byte

func Bytes2Hash

func Bytes2Hash(b []byte) Hash

func Hex2Hash

func Hex2Hash(s string) Hash

func (*Hash) Bytes

func (h *Hash) Bytes() []byte

func (*Hash) Hex

func (h *Hash) Hex() string

func (*Hash) MarshalJSON

func (h *Hash) MarshalJSON() ([]byte, error)

func (*Hash) SetBytes

func (h *Hash) SetBytes(other []byte)

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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