encoder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 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 EncodeNumber

func EncodeNumber(b []byte, message interface{}) error

func ExtractHRP

func ExtractHRP(address string) (string, error)

func MsgPackStruct

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

func MsgPackUnpackStruct

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

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 interface{}
}

Jump to

Keyboard shortcuts

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