util

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToHex

func BytesToHex(bytes []byte) string

BytesToHex converts a byte slice to a hex string with a leading 0x

func Float64ToU8 added in v1.6.2

func Float64ToU8(u float64) (uint8, error)

func IntToU16 added in v1.6.0

func IntToU16(u int) (uint16, error)

func IntToU32 added in v1.6.0

func IntToU32(u int) (uint32, error)

func IntToU64 added in v1.6.0

func IntToU64(u int) (uint64, error)

func IntToU8 added in v1.6.0

func IntToU8(u int) (uint8, error)

func IntToUBigInt added in v1.6.0

func IntToUBigInt(u int) (*big.Int, error)

func ParseHex

func ParseHex(hexStr string) ([]byte, error)

ParseHex Convenience function to deal with 0x at the beginning of hex strings

func Sha3256Hash

func Sha3256Hash(bytes [][]byte) []byte

Sha3256Hash hashes the input bytes using SHA3-256

func StrToBigInt

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

StrToBigInt converts a string to a big.Int for u128 and u256 values

func StrToUint64

func StrToUint64(s string) (uint64, error)

StrToUint64 converts a string to a uint64

func Uint32ToU8 added in v1.6.0

func Uint32ToU8(u uint32) (uint8, error)

func UintToU16 added in v1.6.0

func UintToU16(u uint) (uint16, error)

func UintToU32 added in v1.6.0

func UintToU32(u uint) (uint32, error)

func UintToU8 added in v1.6.0

func UintToU8(u uint) (uint8, error)

func UintToUBigInt added in v1.6.0

func UintToUBigInt(u uint) (*big.Int, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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