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: 35 modules, 43 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址