Documentation
¶
Overview ¶
Package hexnum provides hex encoding/decoding utilities for numeric types. All hex strings use the "0x" prefix convention used in Ethereum.
Index ¶
- func BigIntToHex(num *big.Int) string
- func BytesToHex(b []byte) string
- func Int64ToHex(num int64) string
- func IntToHex(num int) string
- func ParseBigInt(value string) (*big.Int, error)
- func ParseHexBytes(value string) ([]byte, error)
- func ParseHexInt(value string) (int, error)
- func ParseHexInt64(value string) (int64, error)
- func ParseHexUint64(value string) (uint64, error)
- func Uint64ToHex(num uint64) string
- func UintToHex(num uint) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BigIntToHex ¶
BigIntToHex converts a big.Int to a hex string with "0x" prefix.
func BytesToHex ¶
BytesToHex converts a byte slice to a hex string with "0x" prefix.
func Int64ToHex ¶
Int64ToHex converts an int64 to a hex string with "0x" prefix.
func ParseBigInt ¶
ParseBigInt parse hex string value to big.Int
func ParseHexBytes ¶
ParseHexBytes parses a hex string (with optional "0x" prefix) to a byte slice.
func ParseHexInt ¶
ParseHexInt parse hex string value to int
func ParseHexInt64 ¶
ParseHexInt64 parse hex string value to int64
func ParseHexUint64 ¶
ParseHexUint64 parse hex string value to uint64
func Uint64ToHex ¶
Uint64ToHex converts a uint64 to a hex string with "0x" prefix.
Types ¶
This section is empty.