mpchash

package module
v0.0.0-...-7382f34 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: BSD-2-Clause Imports: 2 Imported by: 2

Documentation

Overview

Package mpchash implements a multi-probe consistent hashing strategy

http://arxiv.org/pdf/1505.00062.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Multi

type Multi struct {
	// contains filtered or unexported fields
}

Multi selects buckets with a multi-probe consistent hash

func New

func New(buckets []string, h func(b []byte, s uint64) uint64, seeds [2]uint64, k int) *Multi

New returns a new multi-probe hasher. The hash function h is used with the two seeds to generate k different probes.

func (*Multi) Hash

func (m *Multi) Hash(key string) string

Hash returns the bucket for a given key

Jump to

Keyboard shortcuts

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