encoder

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBase64Padding

func AddBase64Padding(value string) string

func EncodeBytes

func EncodeBytes(args ...EncoderParam) (data []byte, err error)

func ExtractHRP

func ExtractHRP(address string) (string, error)

func MsgPackStruct

func MsgPackStruct(msg interface{}) ([]byte, error)

func MsgPackUnpackStruct

func MsgPackUnpackStruct[T interface{}](b []byte, message *T) error

func NumberFromByte added in v1.2.0

func NumberFromByte(buf []byte) uint64

func NumberToByte

func NumberToByte(i uint64) []byte

func ToBase64Padded

func ToBase64Padded(data []byte) string

Types

type EncoderDataType

type EncoderDataType string
const (
	StringEncoderDataType  EncoderDataType = "string"
	ByteEncoderDataType    EncoderDataType = "byte"
	BigNumEncoderDataType  EncoderDataType = "bignum"
	IntEncoderDataType     EncoderDataType = "int"
	HexEncoderDataType     EncoderDataType = "hex"
	BoolEncoderDataType    EncoderDataType = "bool"
	AddressEncoderDataType EncoderDataType = "address"
)

type EncoderParam

type EncoderParam struct {
	Type  EncoderDataType
	Value any
}

Jump to

Keyboard shortcuts

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