Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rendezvous(highest random weight) hashing

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages