hexutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 5

README

hexutil

Various hex function utilities

Documentation

Index

Constants

View Source
const Leader = "0x"

Leader ...

Variables

View Source
var (
	// ErrNotHexString ...
	ErrNotHexString = errors.New("not a hex string")
)

Functions

func AddLeader

func AddLeader(str string) string

AddLeader ...

func DecodeBigInt

func DecodeBigInt(hexStr string) (*big.Int, error)

DecodeBigInt ...

func DecodeBytes

func DecodeBytes(src []byte) ([]byte, error)

DecodeBytes ...

func DecodeFloat64

func DecodeFloat64(hexStr string) (float64, error)

DecodeFloat64 ...

func DecodeInt

func DecodeInt(hexStr string) (int, error)

DecodeInt ...

func DecodeString

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

DecodeString ...

func DecodeUint64

func DecodeUint64(hexStr string) (uint64, error)

DecodeUint64 decodes a hex string into a uint64

func EncodeBigInt

func EncodeBigInt(i *big.Int) string

EncodeBigInt ....

func EncodeBytes

func EncodeBytes(src []byte) []byte

EncodeBytes ...

func EncodeInt

func EncodeInt(i int) string

EncodeInt ...

func EncodeString

func EncodeString(str string) string

EncodeString ...

func EncodeToString

func EncodeToString(b []byte) string

EncodeToString ...

func EncodeUint64

func EncodeUint64(i uint64) string

EncodeUint64 encodes i as a hex string

func StripLeader

func StripLeader(hexStr string) (string, error)

StripLeader ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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