encoding

package
v0.0.3-RC1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: GPL-3.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// Base10 decimal base
	Base10 = 10
	// Base16 hexadecimal base
	Base16 = 16
	// BitSize64 64 bits
	BitSize64 = 64
	// TenToThePowerOf18 represents 1000000000000000000
	TenToThePowerOf18 = 1000000000000000000
	// Gwei represents 1000000000 wei
	Gwei = 1000000000
	// MaxUint256StrNumber represents 2**256 -1 as string
	MaxUint256StrNumber = "115792089237316195423570985008687907853269984665640564039457584007913129639935"
)

Variables

This section is empty.

Functions

func DecodeBigIntHexOrDecimal

func DecodeBigIntHexOrDecimal(s string) (*big.Int, error)

DecodeBigIntHexOrDecimal parses a string that can be decimal or hexa (starts with 0x) into a *big.Int

func DecodeBytes

func DecodeBytes(val *string) ([]byte, error)

DecodeBytes decodes a hex string into a []byte

func DecodeInt64orHex

func DecodeInt64orHex(val *string) (int64, error)

DecodeInt64orHex decodes a string int64 or hex string into a int64

func DecodeUint256orHex

func DecodeUint256orHex(val *string) (*big.Int, error)

DecodeUint256orHex decodes a string uint256 or hex string into a bit.Int

func DecodeUint64orHex

func DecodeUint64orHex(val *string) (uint64, error)

DecodeUint64orHex decodes a string uint64 or hex string into a uint64

func EncodeBigInt

func EncodeBigInt(b *big.Int) *string

EncodeBigInt encodes a big.Int into a hex string

func EncodeBytes

func EncodeBytes(b []byte) *string

EncodeBytes encodes a []bytes into a hex string

func EncodeUint64

func EncodeUint64(b uint64) *string

EncodeUint64 encodes a uint64 into a hex string

Types

This section is empty.

Jump to

Keyboard shortcuts

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