Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c9s/jchash
Jump Consistent Hashing Algorithm implemented in PHP 7 Extension
https://github.com/c9s/jchash
algorithm consistent-hash-algorithm php php7
Last synced: 3 months ago
JSON representation
Jump Consistent Hashing Algorithm implemented in PHP 7 Extension
- Host: GitHub
- URL: https://github.com/c9s/jchash
- Owner: c9s
- License: mit
- Created: 2017-01-14T08:30:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-27T02:42:17.000Z (over 5 years ago)
- Last Synced: 2024-10-29T10:01:51.011Z (3 months ago)
- Topics: algorithm, consistent-hash-algorithm, php, php7
- Language: C
- Size: 7.81 KB
- Stars: 16
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## JCH - Jump Consistent Hash Extension for PHP7
A Fast, Minimal Memory, Consistent Hash Algorithm.
> We present jump consistent hash, a fast, minimal memory, consistent hash
> algorithm that can be expressed in about 5 lines of code. In comparison to
> the algorithm of Karger et al., jump consistent hash requires no storage, is
> faster, and does a better job of evenly dividing the key space among the
> buckets and of evenly dividing the workload when the number of buckets
> changes. Its main limitation is that the buckets must be numbered
> sequentially, which makes it more suitable for data storage applications than
> for distributed web caching.Paper:
### Usage
```php
$b = jchash("11.22.33.44", 500000);
$b = jchash(4005823, 500000);
```