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. [Caching](/categories/caching)
4. /
5. lyignore/bloom

ActiveLibrary[Caching](/categories/caching)

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 4w 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

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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://avatars.githubusercontent.com/u/27730851?v=4)[lyignore](/maintainers/lyignore)[@LYignore](https://github.com/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)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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