PHPackages                             makinacorpus/php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. makinacorpus/php-bloom

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

makinacorpus/php-bloom
======================

Bloom filter implementation

2.0.2(8y ago)178.9k2[1 issues](https://github.com/makinacorpus/php-bloom/issues)1GPL-2PHP

Since Aug 30Pushed 8y ago2 watchersCompare

[ Source](https://github.com/makinacorpus/php-bloom)[ Packagist](https://packagist.org/packages/makinacorpus/php-bloom)[ RSS](/packages/makinacorpus-php-bloom/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (1)

PHP Bloom filter
================

[](#php-bloom-filter)

[![Build Status](https://camo.githubusercontent.com/dd2607613223da973c5b929bf1dc55dceea515973e601fc7a9e3dad1a7d197f4/68747470733a2f2f7472617669732d63692e6f72672f6d616b696e61636f727075732f7068702d626c6f6f6d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/makinacorpus/php-bloom)

This is a simple PHP Bloom filter implementation using Sherif Ramadan's implementation.

Original code and a really great explaination can be found here

It is slightly modified to correct some coding standard issues, to achieve a more flexible runtime configuration, and fixes a few performance issues.

Usage
-----

[](#usage)

You must first choose a targetted maximum number of elements that your filter will contain, and a false positive implementation, obviously the lesser are those two numbers, the faster the implementation will be.

```
// You may cache this value, and fetch it back, it's the whole goal of this
// API. Beware that the stored string might contain ``\0`` characters, ensure
// your storage API deals with those strings in safe way.
$value = null;

// Configure your Bloom filter, if you store the value, you should store the
// configuration along since selected hash algorithms and string size would
// change otherwise.
$probability = 0.0001
$maxSize = 10000;

$filter = new \MakinaCorpus\Bloom\BloomFilter();

// You may add as many elements as you wish, elements can be any type, really,
// if not scalar they will be serialized prior to being hashed.
$filter->set('some_string');
$filter->set(123456);
$filter->set(['some' => 'array']);
$filter->set(new \stdClass());

// And the whole goal of it:
if ($filter->check('some_value')) {
  do_something();
}
```

Notes
-----

[](#notes)

Please carefully read the original author's blog post, since it explains everything you need to know about Bloom filters:

Please also use it wisely, the hashing algorithms are quite fast, but if you do use it too much, it will impact negatively on your CPU usage.

There are numerous other competitive implementations, you may use whichever seems the best for you, take a look around before choosing.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% 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

Every ~128 days

Total

4

Last Release

3206d ago

Major Versions

1.0.0 → 2.0.02016-08-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/69252826f3a70a19fc5dcefb7ef9d26d465bb300245641abb4dd89d0ec391a66?d=identicon)[pounard](/maintainers/pounard)

![](https://www.gravatar.com/avatar/d21b98752b406528da88850922b1061f39bf72eb2126b413d5c12e275811a40b?d=identicon)[Makina Corpus](/maintainers/Makina%20Corpus)

---

Top Contributors

[![pounard](https://avatars.githubusercontent.com/u/341855?v=4)](https://github.com/pounard "pounard (5 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[magepal/magento2-checkout-success-misc-script

Add Miscellaneous HTML and JavaScript codes to Magento2 checkout confirmation page

2718.2k](/packages/magepal-magento2-checkout-success-misc-script)[magyarjeti/laravel-lipsum

Lorem ipsum generator for Laravel Framework

1617.9k](/packages/magyarjeti-laravel-lipsum)

PHPackages © 2026

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