PHPackages                             moyu-hu/bloom - 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. moyu-hu/bloom

ActiveLibrary

moyu-hu/bloom
=============

Bloom filter and Cuckoo filter based on php language

10PHP

Since Jun 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/zonghua-hu/bloom)[ Packagist](https://packagist.org/packages/moyu-hu/bloom)[ RSS](/packages/moyu-hu-bloom/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

bloom
=====

[](#bloom)

Bloom filter and Cuckoo filter based on php language

引入composer包
===========

[](#引入composer包)

`composer require moyu-hu/bloom`

redis bloom 模块
--------------

[](#redis-bloom-模块)

```
1.需要开启redis的module功能，参考链接：https://www.cnblogs.com/emunshe/p/13690115.html
2.如果make失败，也可以用项目中的redisbloom.so文件
3.开启redis的模块并重启。redis的配置文件中加上这句代码：loadmodule /你的路径/redisbloom.so
4.目前版本集成redis的bloom模块布隆和布谷鸟所有的方法。

```

思路
--

[](#思路)

```
1.对于过滤器不支持的方法，返回false,具体支持的方法请见各个实例类的method
2.对于不同过滤器命令不一样的问题，需要实现抽象方法获取区别参数和命令
3.部分相同命令方法通过type区分不同实例，并获取对应命令
4.bucket默认按照不同过滤器区分，也可自定义

```

使用说明
----

[](#使用说明)

#### 单例布隆

[](#单例布隆)

```
$bloomFactory = BloomSingle::createBloom($redisConfig);
$bloomFactory->add($address);

```

#### 多例布隆

[](#多例布隆)

```
$bloomMultiple = BloomFactory::getInstance($config, BloomEnums::BLOOM_FILTER);
$bloomMultiple->add($address);

```

#### 单例布谷鸟

[](#单例布谷鸟)

```
$cuckooFactory = BloomSingle::createCuckoo($redisConfig);
$cuckooFactory->add($address);

```

#### 多例布谷鸟

[](#多例布谷鸟)

```
$cuckooMultiple = BloomFactory::getInstance($config);
$cuckooMultiple->add($address);

```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b800dfe07a771137011a2a3cca79b803c12ba7c94c5aae9f9a0fe6125f9599e?d=identicon)[zonghua-hu](/maintainers/zonghua-hu)

---

Top Contributors

[![zonghua-hu](https://avatars.githubusercontent.com/u/37233180?v=4)](https://github.com/zonghua-hu "zonghua-hu (9 commits)")

### Embed Badge

![Health badge](/badges/moyu-hu-bloom/health.svg)

```
[![Health](https://phpackages.com/badges/moyu-hu-bloom/health.svg)](https://phpackages.com/packages/moyu-hu-bloom)
```

PHPackages © 2026

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