bytes

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// AddressByteLength is the Standard Address Byte Length
	AddressByteLength = 20
	// HashByteLength is the Standard Hash Byte Length
	HashByteLength = 32
	// EcdsaSignatureLength is the Standard ECDSA Signature length
	EcdsaSignatureLength = 65
	// EcdsaPubKeySize is the Standard ECDSA Public Key Size
	EcdsaPubKeySize = 65
	// EcdsaPubKeyCompressedSize is the Standard compressed ECDSA Public Key Size
	EcdsaPubKeyCompressedSize = 33
	// EcdsaPrivKeySize is the Standard ECDSA Private Key Size
	EcdsaPrivKeySize = 32
)

Variables

This section is empty.

Functions

func AddressToHex

func AddressToHex(value []byte) (string, error)

AddressToHex returns the string value of an address. Addresses must be a 20 byte array.

Types

type Address added in v0.3.8

type Address [AddressByteLength]byte

Address is the fixed (20) byte array of an address

func AddressFromHex

func AddressFromHex(s string) (*Address, error)

AddressFromHex will return the [20]byte value of a address hex string Any values exceeding [20]byte will be trimmed.

func BytesToAddress added in v0.3.8

func BytesToAddress(val []byte) *Address

func (*Address) Bytes added in v0.3.8

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

Bytes returns the address as []byte representation.

func (*Address) SetBytes added in v0.3.8

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

func (*Address) String added in v0.3.8

func (a *Address) String() string

String returns the 0x prefixed hex string representation of the address.

type Hash added in v0.3.8

type Hash [HashByteLength]byte

Hash is the fixed (32) byte array of a hash

func BytesToHash added in v0.3.8

func BytesToHash(val []byte) *Hash

func (*Hash) Bytes added in v0.3.8

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

func (*Hash) SetBytes added in v0.3.8

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

Jump to

Keyboard shortcuts

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