common

package
v2.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hasher = func(data ...[]byte) []byte {
	hasher := sha256.New()
	for i := 0; i < len(data); i++ {
		hasher.Write(data[i])
	}
	return hasher.Sum(nil)
}

Hasher exports default hash function for trie

Functions

func Compactz

func Compactz(argv []byte) []byte

Compactz returns nil if argument is empty or zero

func GobDecode

func GobDecode(v []byte, e interface{}) error

GobDecode decodes a gob-encoded value v.

func GobEncode

func GobEncode(e interface{}) ([]byte, error)

GobEncode encodes e by using gob and returns.

func HandleKillSig

func HandleKillSig(handler func(), logger *log.Logger) interrupt

HandleKillSig gets killing signals (interrupt, quit and terminate) and calls a registered handler function for cleanup. Finally, this will exit program

func IsZero

func IsZero(argv []byte) bool

IsZero returns true if argument is empty or zero

func PathMkdirAll

func PathMkdirAll(paths ...string) string

PathMkdirAll make a path by joining paths and create directory if not exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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