util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir copies a directory from src to dst.

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a single file from src to dst.

func Float64ToStr

func Float64ToStr(val float64) string

Float64ToStr converts type float64 to string.

func GetKey

func GetKey(n int) []byte

GetKey returns a key whose size is 32 bytes.

func GetValue

func GetValue(n int) []byte

GetValue returns a byte slice according to the given n.

func GetValue16B

func GetValue16B() []byte

GetValue16B return a value whose size is 16 bytes.

func GetValue4K

func GetValue4K() []byte

GetValue4K returns a value whose size is 4 KB.

func MemHash

func MemHash(buf []byte) uint64

MemHash is the hash function used by go map, it utilizes available hardware instructions(behaves as aeshash if aes instruction is available). NOTE: The hash seed changes for every process. So, this cannot be used as a persistent hash.

func PathExist

func PathExist(path string) bool

PathExist checks if the file or directory corresponding to the path exists.

func StrToFloat64

func StrToFloat64(val string) (float64, error)

StrToFloat64 converts type string to float64.

func StrToInt64

func StrToInt64(val string) (int64, error)

StrToInt64 converts type string to int64.

func StrToUint

func StrToUint(val string) (uint64, error)

StrToUint converts type string to uint64.

Types

type Murmur128

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

func NewMurmur128

func NewMurmur128() *Murmur128

func (*Murmur128) EncodeSum128

func (m *Murmur128) EncodeSum128() []byte

func (*Murmur128) Reset

func (m *Murmur128) Reset()

func (*Murmur128) Write

func (m *Murmur128) Write(b []byte) error

Jump to

Keyboard shortcuts

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