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

ActiveLibrary

lyignore/bloom
==============

Bloem algorithm combined with redis implementation

04PHP

Since Mar 12Pushed 7y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

 bloom
=======

[](#-bloom-)

 Bloem algorithm combined with redis implementation.

Installing
----------

[](#installing)

```
$ composer require lyignore/bloom -vvv
```

Usage
-----

[](#usage)

对Bloom过滤器进行实现，引入redis的bitmap,替换int模拟的数组，节省了内存空间 可自定义bitmap存储地址，不手动删除bitmap会永久存储

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

use Lyignore\Bloom\BloomFilter;
use Lyignore\Bloom\BitArray;
$config = [
    'redis' => [
        'scheme' => 'tcp',
        'redis_host' => '127.0.0.1',
        'redis_password' => null,
        'redis_port' => '6379'
    ],
    'path' => 'test:bitArr',
    'bitArrayLen' => 100000,    //位数组长度
    'dataAmount' => 1000000     //集合总量
];
$list = array(
    'http://test/1',
    'http://test/2',
    'http://test/3',
    'http://test/4',
    'http://test/5',
    'http://test/6',
    'http://test/1',
    'http://test/2',
);
$bloom = new BloomFilter($config);
foreach($list as $k => $v){
    if($bloom->find($v)){
        echo $v."已经存在\n";
    }else{
        $bloom->add($v);
        echo "添加".$v."\n";
    }
}

//删除bitmap
$bloom->delete('test:bitArr');

```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/lyignore/bloom/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/lyignore/bloom/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

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/1d14ab89a56f320a46083354c9bbb5cdc474a3eb97b92b2644fa9f2fe08d8b43?d=identicon)[lyignore](/maintainers/lyignore)

---

Top Contributors

[![LYignore](https://avatars.githubusercontent.com/u/27730851?v=4)](https://github.com/LYignore "LYignore (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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