hash

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(x bool) uint64

func BytesLike

func BytesLike[H ~string | ~[]byte](x H) uint64

func Complex64

func Complex64(c complex128) uint64

func Float64

func Float64(x float64) uint64

func Hash

func Hash[H Hashable](h H) uint64

func HashSlice

func HashSlice[H Hashable, HS ~[]H](hs HS) uint64

func Int64

func Int64(x int64) uint64

func Uint64

func Uint64(x uint64) uint64

Types

type Hashable

type Hashable interface {
	Hash(state Hasher)
}

type Hasher

type Hasher interface {
	Finish() uint64

	Write(data []byte)
	WriteInt(i int)
	WriteInt8(i int8)
	WriteInt16(i int16)
	WriteInt32(i int32)
	WriteInt64(i int64)
	WriteUint(i uint)
	WriteUint8(i uint8)
	WriteUint16(i uint16)
	WriteUint32(i uint32)
	WriteUint64(i uint64)
	WriteFloat32(f float32)
	WriteFloat64(f float64)
	WriteBool(v bool)
}

Jump to

Keyboard shortcuts

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