hexnum

package
v0.0.0-...-ea2125a Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hexnum provides hex encoding/decoding utilities for numeric types. All hex strings use the "0x" prefix convention used in Ethereum.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntToHex

func BigIntToHex(num *big.Int) string

BigIntToHex converts a big.Int to a hex string with "0x" prefix.

func BytesToHex

func BytesToHex(b []byte) string

BytesToHex converts a byte slice to a hex string with "0x" prefix.

func Int64ToHex

func Int64ToHex(num int64) string

Int64ToHex converts an int64 to a hex string with "0x" prefix.

func IntToHex

func IntToHex(num int) string

IntToHex converts an int to a hex string with "0x" prefix.

func ParseBigInt

func ParseBigInt(value string) (*big.Int, error)

ParseBigInt parse hex string value to big.Int

func ParseHexBytes

func ParseHexBytes(value string) ([]byte, error)

ParseHexBytes parses a hex string (with optional "0x" prefix) to a byte slice.

func ParseHexInt

func ParseHexInt(value string) (int, error)

ParseHexInt parse hex string value to int

func ParseHexInt64

func ParseHexInt64(value string) (int64, error)

ParseHexInt64 parse hex string value to int64

func ParseHexUint64

func ParseHexUint64(value string) (uint64, error)

ParseHexUint64 parse hex string value to uint64

func Uint64ToHex

func Uint64ToHex(num uint64) string

Uint64ToHex converts a uint64 to a hex string with "0x" prefix.

func UintToHex

func UintToHex(num uint) string

UintToHex converts a uint to a hex string with "0x" prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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