fnv1a

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: BSD-2-Clause Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddArray added in v1.0.0

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

func AddHashableArray added in v1.0.0

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

func AddHashableMap added in v1.0.0

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

func AddMap added in v1.0.0

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 added in v1.0.0

func HashBool(v bool) Hash

func HashBytes added in v1.0.0

func HashBytes(v []byte) Hash

func HashFloat32 added in v1.0.0

func HashFloat32(v float32) Hash

func HashFloat64 added in v1.0.0

func HashFloat64(v float64) Hash

func HashInt32 added in v1.0.0

func HashInt32(v int32) Hash

func HashInt64 added in v1.0.0

func HashInt64(v int64) Hash

func HashString added in v1.0.0

func HashString(v string) Hash

func NewHash

func NewHash() Hash

func ZeroHash added in v1.0.0

func ZeroHash() Hash

type HashMapKey added in v1.0.0

type HashMapKey uint32

type Hashable added in v1.0.0

type Hashable interface {
	ComputeHash() Hash
}

Jump to

Keyboard shortcuts

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