hex

package
v0.0.0-...-47b5856 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeString

func DecodeString(s string) (b []byte, err error)

DecodeString parses the given hex string to bytes, it can return error if the hex string is invalid. Follows the semantic of ethereum's FromHex.

func EnsurePrefix

func EnsurePrefix(str string) string

EnsurePrefix adds the prefix (0x) to a given hex string.

func HasPrefix

func HasPrefix(str string) bool

HasPrefix returns true if the string starts with 0x.

func ParseBig

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

ParseBig parses the given hex string and returns error if it is invalid.

func TrimPrefix

func TrimPrefix(str string) string

TrimPrefix removes the prefix (0x) of a given 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