util

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongType = errors.New("wrong data type held by interface{}")

Functions

func BytesToTime added in v0.2.0

func BytesToTime(b []byte) (time.Time, error)

BytesToTime converts []byte to time

func BytesToUint64

func BytesToUint64(b []byte) uint64

BytesToUint64 converts []byte to uint64

func CopyBytes

func CopyBytes(b []byte) []byte

CopyBytes copy []byte to another []byte

func IsAllZeros added in v0.1.9

func IsAllZeros(b []byte) bool

IsAllZeros return true if all bytes are zero

func Sort added in v0.2.5

func Sort(candidates map[string]*big.Int, seed uint64) []string

Sort sorts candidates, with ts to resolve the equal case

func TimeToBytes added in v0.2.0

func TimeToBytes(t time.Time) ([]byte, error)

TimeToBytes converts time to []byte

func ToBigInt added in v0.3.5

func ToBigInt(v interface{}) (*big.Int, error)

func ToEtherAddress added in v0.3.5

func ToEtherAddress(v interface{}) (common.Address, error)

func Uint64ToBytes

func Uint64ToBytes(u uint64) []byte

Uint64ToBytes converts uint64 to []byte

func Uint64ToInt64 added in v0.2.0

func Uint64ToInt64(u uint64) int64

Uint64ToInt64 converts uint64 to int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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