util

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 63

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Diff1 = StringToBig("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")
View Source
var Ether = math.BigPow(10, 18)
View Source
var Shannon = math.BigPow(10, 9)

Functions

func DiffFloatToInt

func DiffFloatToInt(diffFloat float64) (diffInt int64)

func DiffIntToFloat

func DiffIntToFloat(diffInt int64) (diffFloat float64)

func FormatRatReward

func FormatRatReward(reward *big.Rat) string

func FormatReward

func FormatReward(reward *big.Int) string

func GetTargetHex

func GetTargetHex(diff int64) string

func IsValidHexAddress

func IsValidHexAddress(s string) bool

func IsZeroHash

func IsZeroHash(s string) bool

func MakeTimestamp

func MakeTimestamp() int64

func MustParseDuration

func MustParseDuration(s string) time.Duration

func String2Big

func String2Big(num string) *big.Int

func StringInSlice

func StringInSlice(a string, list []string) bool

func StringToBig

func StringToBig(h string) *big.Int

func TargetHexToDiff

func TargetHexToDiff(targetHex string) *big.Int

func ToHex

func ToHex(n int64) string

func ToHex1

func ToHex1(n int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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