fnv1a

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddArray

func AddArray[T any](h Hash, elements []T, hasher func(Hash, T))

func AddHashableArray

func AddHashableArray[T Hashable](h Hash, elements []T)

func AddHashableMap

func AddHashableMap[T Hashable](h Hash, elements map[string]T)

func AddMap

func AddMap[T any](h Hash, elements map[string]T, hasher func(Hash, T))

Types

type Hash

type Hash interface {
	fmt.Stringer
	AddInt32(v int32)
	AddInt64(v int64)
	AddFloat32(v float32)
	AddFloat64(v float64)
	AddBool(v bool)
	AddString(v string)
	AddBytes(v []byte)
	Add(other Hash)
	Equals(other Hash) bool
	MapKey() HashMapKey
	// contains filtered or unexported methods
}

Hash provides the set of functions needed to compute a running fnv1a of the supported rest.li primitives

func HashBool

func HashBool(v bool) Hash

func HashBytes

func HashBytes(v []byte) Hash

func HashFloat32

func HashFloat32(v float32) Hash

func HashFloat64

func HashFloat64(v float64) Hash

func HashInt32

func HashInt32(v int32) Hash

func HashInt64

func HashInt64(v int64) Hash

func HashString

func HashString(v string) Hash

func NewHash

func NewHash() Hash

func ZeroHash

func ZeroHash() Hash

type HashMapKey

type HashMapKey uint32

type Hashable

type Hashable interface {
	ComputeHash() Hash
}

Jump to

Keyboard shortcuts

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