common

package
v0.0.0-...-215cb89 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: GPL-3.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

View Source
const (
	OpAdd = 0
	OpDel = 1
	OpUpt = 2
)
View Source
const MaxUint64 uint64 = 18446744073709551615

Variables

View Source
var (
	Big1   = big.NewInt(1)
	Big2   = big.NewInt(2)
	Big3   = big.NewInt(3)
	Big0   = big.NewInt(0)
	Big32  = big.NewInt(32)
	Big256 = big.NewInt(256)
	Big257 = big.NewInt(257)
)

Common big integers often used

Functions

func Clone

func Clone(src, dst interface{}) error

deep clone object from a to b

func Compress

func Compress(b []byte) []byte

func Expand

func Expand(b []byte) []byte

func PaddedAppend

func PaddedAppend(size uint, src []byte) []byte

PaddedAppend appends the src byte slice to dst, returning the new slice. If the length of the source is smaller than the passed size, leading zero bytes are appended to the dst slice before appending src.

func PrettyPrintJson

func PrettyPrintJson(b []byte) []byte

func RandString

func RandString(ulen uint8) string

func Rcopy

func Rcopy(dst []byte, src []byte) int

func String

func String(b []byte) string

func Uint64ToBytes

func Uint64ToBytes(i uint64) []byte

Types

This section is empty.

Directories

Path Synopsis
Package bitutil implements fast bitwise operations.
Package bitutil implements fast bitwise operations.
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
Package math provides integer math utilities.
Package math provides integer math utilities.
Package common contains various helper functions.
Package common contains various helper functions.

Jump to

Keyboard shortcuts

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