dkkoma/hrw

Rendezvous(highest random weight) hashing

Maintainers

Details

github.com/dkkoma/hrw

Source

Issues

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/dkkoma/hrw

dev-master 2020-01-15 02:28 UTC

This package is auto-updated.

Last update: 2025-09-15 16:03:39 UTC


README

HRW

This is Rendezvous(highest random weight) hashing library. It requires PHP7+.

Installation

composer require dkkoma/hrw

Usage

$nodes = ['node-1', 'node-2', 'node-3'];
$hrw = new Hrw\Hrw($nodes);

$key = 'test-key';

$node = $hrw->pick($key); // node-2

FYI

https://en.wikipedia.org/wiki/Rendezvous_hashing