util

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToFloat64

func ByteToFloat64(bytes []byte) float64

func ByteToString

func ByteToString(b []byte) string

ByteToString converts byte slice to a string without memory allocation.

func Float64ToByte

func Float64ToByte(float float64) []byte

func Max

func Max(x, y int) int

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 Min

func Min(x, y int) int

func PathExist

func PathExist(path string) bool

func StringToByte

func StringToByte(s string) (b []byte)

StringToByte converts string to a byte slice without memory allocation.

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(p []byte) error

Jump to

Keyboard shortcuts

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