maphash

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 22

README

maphash

Hash any comparable type using Golang's fast runtime hash. Uses AES instructions when available.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

type Hasher[K comparable] struct {
	// contains filtered or unexported fields
}

Hasher hashes values of type K. Uses runtime AES-based hashing.

func NewHasher

func NewHasher[K comparable]() Hasher[K]

NewHasher creates a new Hasher[K] with a random seed.

func NewSeed

func NewSeed[K comparable](h Hasher[K]) Hasher[K]

NewSeed returns a copy of |h| with a new hash seed.

func (Hasher[K]) Hash

func (h Hasher[K]) Hash(key K) uint64

Hash hashes |key|.

Jump to

Keyboard shortcuts

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