PHPackages                             out001a/consistent-hash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. out001a/consistent-hash

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

out001a/consistent-hash
=======================

a consistent hash library implemented by PHP

1.1(8y ago)2171MITPHPPHP &gt;=5.6.0

Since Jun 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/out001a/consistent-hash)[ Packagist](https://packagist.org/packages/out001a/consistent-hash)[ RSS](/packages/out001a-consistent-hash/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

consistent hash
===============

[](#consistent-hash)

Usage
-----

[](#usage)

```
$ composer require out001a/consistent-hash
```

```
require 'vendor/autoload.php';

use Out001a\ConsistentHash;

$chash = new ConsistentHash('test');

// 增加节点
$chash->addNode('127.0.0.1:80');
$chash->addNode('127.0.0.1:81');
$chash->addNode('127.0.0.1:82');

// 查找字符串哈希到的节点
var_dump('abc -> '.$chash->lookup('abc'));
var_dump('def -> '.$chash->lookup('def'));
var_dump('ghi -> '.$chash->lookup('ghi'));

echo "\n========\n\n";

// 删除某个节点
$chash->removeNode('127.0.0.1:82');

// 再次查找节点
var_dump('abc -> '.$chash->lookup('abc'));
var_dump('def -> '.$chash->lookup('def'));
var_dump('ghi -> '.$chash->lookup('ghi'));
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3267d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5535e4c9a76da38b92f04aad1775d0e3a44805880886b5bb4962f2497cd2858?d=identicon)[out001a](/maintainers/out001a)

---

Top Contributors

[![out001a](https://avatars.githubusercontent.com/u/1430716?v=4)](https://github.com/out001a "out001a (6 commits)")

### Embed Badge

![Health badge](/badges/out001a-consistent-hash/health.svg)

```
[![Health](https://phpackages.com/badges/out001a-consistent-hash/health.svg)](https://phpackages.com/packages/out001a-consistent-hash)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
