address

package
v0.0.0-...-d745eb2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: LGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// HashLength is the expected length of the hash
	HashLength = 32
	// AddressLength is the expected length of the address
	AddressLength = 21
	// AddressLengthBase58 is the expected length of the address in base58format
	AddressLengthBase58 = 34
	// TronBytePrefix is the hex prefix to address
	TronBytePrefix = byte(0x41)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address []byte

Address represents the 21 byte address of an Tron account.

func Base58ToAddress

func Base58ToAddress(s string) (Address, error)

Base58ToAddress returns Address with byte values of s.

func Base64ToAddress

func Base64ToAddress(s string) (Address, error)

Base64ToAddress returns Address with byte values of s.

func BigToAddress

func BigToAddress(b *big.Int) Address

BigToAddress returns Address with byte values of b. If b is larger than len(h), b will be cropped from the left.

func HexToAddress

func HexToAddress(s string) Address

HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.

func PubkeyToAddress

func PubkeyToAddress(p ecdsa.PublicKey) Address

PubkeyToAddress returns address from ecdsa public key

func (Address) Bytes

func (a Address) Bytes() []byte

Bytes get bytes from address

func (Address) Hex

func (a Address) Hex() string

Hex get bytes from address in string

func (*Address) Scan

func (a *Address) Scan(src interface{}) error

Scan implements Scanner for database/sql.

func (Address) String

func (a Address) String() string

String implements fmt.Stringer.

func (Address) Value

func (a Address) Value() (driver.Value, error)

Value implements valuer for database/sql.

Jump to

Keyboard shortcuts

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