util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEBUG = 10
	INFO  = 20
	WARN  = 30
	ERROR = 40
	SHARE = 100
	BLOCK = 101

	Debug *PoolLogger
	Info  *PoolLogger
	Warn  *PoolLogger
	Error *PoolLogger

	ShareLog *PoolLogger
	BlockLog *PoolLogger
)
View Source
var LTC = math.BigPow(10, 8)
View Source
var Satoshi = math.BigPow(10, 0)

Functions

func Ae64Decode

func Ae64Decode(str string, key []byte) ([]byte, error)

func Ae64Encode

func Ae64Encode(src []byte, key []byte) (string, error)

func FormatRatReward

func FormatRatReward(reward *big.Rat) string

func FormatReward

func FormatReward(reward *big.Int) string

func GetTargetHex

func GetTargetHex(diff int64) string

func Hash256StratumFormat

func Hash256StratumFormat(hexStr string) (string, error)

func InitLog

func InitLog(infoFile, errorFile, shareFile, blockFile string, setLevel int)

func IsValidLTCAddress

func IsValidLTCAddress(address 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 TargetHash256StratumFormat

func TargetHash256StratumFormat(hexStr string) (string, error)

func TargetHexToDiff

func TargetHexToDiff(targetHex string) *big.Int

func ToHex

func ToHex(n int64) string

Types

type PoolLogger

type PoolLogger struct {
	// contains filtered or unexported fields
}

func (*PoolLogger) Fatal

func (l *PoolLogger) Fatal(v ...interface{})

func (*PoolLogger) Fatalf

func (l *PoolLogger) Fatalf(format string, v ...interface{})

func (*PoolLogger) Fatalln

func (l *PoolLogger) Fatalln(v ...interface{})

func (*PoolLogger) Panic

func (l *PoolLogger) Panic(v ...interface{})

func (*PoolLogger) Panicf

func (l *PoolLogger) Panicf(format string, v ...interface{})

func (*PoolLogger) Panicln

func (l *PoolLogger) Panicln(v ...interface{})

func (*PoolLogger) Print

func (l *PoolLogger) Print(v ...interface{})

func (*PoolLogger) Printf

func (l *PoolLogger) Printf(format string, v ...interface{})

func (*PoolLogger) Println

func (l *PoolLogger) Println(v ...interface{})

Jump to

Keyboard shortcuts

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