utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDecimalString = errors.New("invalid decimal string")
)

Functions

func AddressToHex

func AddressToHex(addr common.Address) string

func BytesToAddress

func BytesToAddress(b []byte) common.Address

func BytesToHash

func BytesToHash(b []byte) common.Hash

func BytesToUint64

func BytesToUint64(b []byte) (uint64, error)

func DecodeHex

func DecodeHex(s string) ([]byte, error)

func EncodeToHex

func EncodeToHex(b []byte) string

func HashToHex

func HashToHex(h common.Hash) string

func HexToAddress

func HexToAddress(s string) common.Address

func HexToBytes

func HexToBytes(s string) ([]byte, error)

func HexToHash

func HexToHash(s string) common.Hash

func HexToPrivateKey

func HexToPrivateKey(s string) (*ecdsa.PrivateKey, error)

func IsHexAddress

func IsHexAddress(s string) bool

func IsHexHash

func IsHexHash(s string) bool

func StringToBigInt added in v0.3.1

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

func StringToUint64 added in v0.3.0

func StringToUint64(s string) (uint64, error)

func Uint64ToBytes

func Uint64ToBytes(i uint64) []byte

func Uint64ToString added in v0.3.0

func Uint64ToString(i uint64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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