common

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountNameToBytes32

func AccountNameToBytes32(accountName string) []byte

func AddressStrToBytes

func AddressStrToBytes(addr string) []byte

func AmountToPackedAmountBytes

func AmountToPackedAmountBytes(a *big.Int) (res []byte, err error)

func CleanAccountName

func CleanAccountName(name string) string

func ConcatKeccakHash

func ConcatKeccakHash(oldHash, paddingValue []byte) []byte

func DecodeAddress

func DecodeAddress(addr string) ([]byte, error)

func FeeToPackedFeeBytes

func FeeToPackedFeeBytes(a *big.Int) (res []byte, err error)

func KeccakHash

func KeccakHash(value []byte) []byte

func LowerCase

func LowerCase(s string) string

func MinInt64

func MinInt64(x, y int64) int64

func OmitSpace

func OmitSpace(s string) string

func OmitSpaceMiddle

func OmitSpaceMiddle(s string) (rs string)

func PaddingAddressIntoBuf

func PaddingAddressIntoBuf(buf *bytes.Buffer, address string) (err error)

func PaddingInt64IntoBuf

func PaddingInt64IntoBuf(buf *bytes.Buffer, a int64)

func PaddingPkIntoBuf

func PaddingPkIntoBuf(buf *bytes.Buffer, pkStr string) (err error)

func PaddingStringBigIntIntoBuf

func PaddingStringBigIntIntoBuf(buf *bytes.Buffer, aStr string) error

func ParsePubKey

func ParsePubKey(pkStr string) (pk *eddsa.PublicKey, err error)

func PrefixPaddingBufToChunkSize

func PrefixPaddingBufToChunkSize(buf []byte) []byte

func ReadAddress

func ReadAddress(buf []byte, offset int) (newOffset int, res string)

func ReadBytes32

func ReadBytes32(buf []byte, offset int) (newOffset int, res []byte)

func ReadUint128

func ReadUint128(buf []byte, offset int) (newOffset int, res *big.Int)

func ReadUint16

func ReadUint16(buf []byte, offset int) (newOffset int, res uint16)

func ReadUint256

func ReadUint256(buf []byte, offset int) (newOffset int, res *big.Int)

func ReadUint32

func ReadUint32(buf []byte, offset int) (newOffset int, res uint32)

func ReadUint40

func ReadUint40(buf []byte, offset int) (newOffset int, res int64)

func ReadUint8

func ReadUint8(buf []byte, offset int) (newOffset int, res uint8)

func SerializeAccountName

func SerializeAccountName(a []byte) string

func SuffixPaddingBufToChunkSize

func SuffixPaddingBufToChunkSize(buf []byte) []byte

func ToPackedAmount

func ToPackedAmount(amount *big.Int) (res int64, err error)

ToPackedAmount : convert big int to 40 bit, 5 bits for 10^x, 35 bits for a * 10^x

func ToPackedFee

func ToPackedFee(amount *big.Int) (res int64, err error)

ToPackedFee : convert big int to 16 bit, 5 bits for 10^x, 11 bits for a * 10^x

func Uint128ToBytes

func Uint128ToBytes(a *big.Int) []byte

func Uint16ToBytes

func Uint16ToBytes(a uint16) []byte

func Uint24ToBytes

func Uint24ToBytes(a int64) []byte

func Uint256ToBytes

func Uint256ToBytes(a *big.Int) []byte

func Uint32ToBytes

func Uint32ToBytes(a uint32) []byte

func Uint40ToBytes

func Uint40ToBytes(a int64) []byte

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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