Skip to content

dkkoma/hrw

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published