common

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 6 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 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