hash

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JumpHash added in v1.9.0

func JumpHash(key uint64, numBuckets int) int

JumpHash consistently chooses a bucket in the range [0, numBuckets) for the given key. Zero or negative numBuckets are treated as numBuckets = 1. See: https://arxiv.org/pdf/1406.2294.pdf

Go implementation from https://github.com/go-distsys/jumphash.

func JumpHashStr added in v1.9.0

func JumpHashStr(key string, numBuckets int) int

JumpHashStr is like JumpHash, but takes a string key and xxh3-hashes it.

func XXH3Hex

func XXH3Hex(b []byte) string

XXH3Hex returns 64-bit xxh3 hash in hexadecimal form (16 chars).

Types

This section is empty.

Jump to

Keyboard shortcuts

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