PHPackages                             scienide/okbloomer - 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. scienide/okbloomer

AbandonedArchivedLibrary

scienide/okbloomer
==================

An autoscaling Bloom filter with ultra-low memory usage for PHP.

1.0.0(4y ago)218.2kMITPHPPHP &gt;=7.4

Since Jun 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Scien-ide/OkBloomer)[ Packagist](https://packagist.org/packages/scienide/okbloomer)[ GitHub Sponsors](https://github.com/sponsors/andrewdalpino)[ RSS](/packages/scienide-okbloomer/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Ok Bloomer
==========

[](#ok-bloomer)

An autoscaling [Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter) with ultra-low memory footprint for PHP. Ok Bloomer employs a layered filtering strategy that allows it to expand while maintaining an upper bound on the false positive rate. Each layer is comprised of a bitmap that remembers the hash signatures of the items inserted so far. If an item gets caught in the filter, then it has probably been seen before. However, if an item passes through the filter, then it definitely has never been seen before. Bloom filters find uses in caching systems, stream deduplication, [DNA sequence counting](https://github.com/Scien-ide/DNAHash), and many more.

- **Ultra-low** memory footprint
- **Autoscaling** works on streaming data
- **Bounded** maximum false positive rate
- **Open-source** and free to use commercially

Installation
------------

[](#installation)

Install into your project using [Composer](https://getcomposer.org/):

```
$ composer require scienide/okbloomer
```

### Requirements

[](#requirements)

- [PHP](https://php.net/manual/en/install.php) 7.4 or above

Bloom Filter
------------

[](#bloom-filter)

A probabilistic data structure that estimates the prior occurrence of a given item with a maximum false positive rate.

### Parameters

[](#parameters)

\#NameDefaultTypeDescription1maxFalsePositiveRate0.01floatThe false positive rate to remain below.2numHashes4int, nullThe number of hash functions used, i.e. the number of slices per layer. Set to `null` for auto.3layerSize32000000intThe size of each layer of the filter in bits.### Example

[](#example)

```
use OkBloomer\BloomFilter;

$filter = new BloomFilter(0.01, 4, 32000000);

$filter->insert('foo');

echo $filter->exists('foo');

echo $filter->existsOrInsert('bar');

echo $filter->exists('bar');
```

```
true

false

true

```

Testing
-------

[](#testing)

To run the unit tests:

```
$ composer test
```

Static Analysis
---------------

[](#static-analysis)

To run static code analysis:

```
$ composer analyze
```

Benchmarks
----------

[](#benchmarks)

To run the benchmarks:

```
$ composer benchmark
```

References
----------

[](#references)

- \[1\] P. S. Almeida et al. (2007). Scalable Bloom Filters.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Every ~175 days

Total

2

Last Release

1617d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/643b22cfe15a5f3ff42dc06ce98f1e5024b6e4578fc9627a058097f5046164d8?d=identicon)[andrewdalpino](/maintainers/andrewdalpino)

---

Top Contributors

[![andrewdalpino](https://avatars.githubusercontent.com/u/18690561?v=4)](https://github.com/andrewdalpino "andrewdalpino (12 commits)")

---

Tags

bloom-filterphpscalable-bloom-filterBloom Filterscalable bloom filterlayered bloom filter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/scienide-okbloomer/health.svg)

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

###  Alternatives

[pleonasm/bloom-filter

A pure PHP implementation of a Bloom Filter

76745.5k6](/packages/pleonasm-bloom-filter)

PHPackages © 2026

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