consistenthash

package
v0.0.0-...-2f0df27 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package consistenthash implements the consistent hashing algorithms that map a key to one of a set of servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Jump

func Jump(key uint64, numBuckets int) int

Jump implements the Jump consistent hashing algorithm. Copied from: https://github.com/dgryski/go-jump Google's "Jump" Consistent Hash function: https://arxiv.org/abs/1406.2294

func RendezvousScore

func RendezvousScore(keyHash uint64, node string) uint64

RendezvousScore scores a (key, node) pair for Rendezvous (Highest-Random-Weight) hashing: the node with the highest score owns the key. The key is hashed once by the caller; mixing the per-node hash with a splitmix64-style finalizer decorrelates the two so the ranking behaves like an independent draw per (key, node) pair, without allocating a combined string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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