PHPackages                             joegreen0991/hyperloglog - 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. joegreen0991/hyperloglog

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

joegreen0991/hyperloglog
========================

A hyper log log with min hash data structure library, for counting cardinalities. Union and intersection capable

v1.0.0(11y ago)2116.9k↑108.9%5MITPHPPHP &gt;=5.3.0

Since Jul 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/joegreen0991/hyperloglog)[ Packagist](https://packagist.org/packages/joegreen0991/hyperloglog)[ Docs](http://www.github.com/joegreen0991/HyperLogLog)[ RSS](/packages/joegreen0991-hyperloglog/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

HyperLogLog &amp; MinHash
=========================

[](#hyperloglog--minhash)

PHP implementation of the HyperLogLog algorithm. [Based on Antirez/Redis implementation.](https://github.com/antirez/redis/blob/unstable/src/hyperloglog.c)

### Resources

[](#resources)

- [The original HLL algorithm from Phillipe Flajolet](http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf)
- [An actual paper on the algorithm with real maths and scary equations.](http://stefanheule.com/papers/edbt2013-hyperloglog.pdf)
- [Awesome explanation and experimental data from AdRoll](http://tech.adroll.com/media/hllminhash.pdf)
- [Very nice blog post explaining what the HLL this is ;)](http://research.neustar.biz/2012/10/25/sketch-of-the-day-hyperloglog-cornerstone-of-a-big-data-infrastructure/)

### Note!

[](#note)

This version has been tuned to work with a P value of 14. This is a register size of 2^14 Bytes = 16KB

There is a large bias that can be seen in the graphs below, which begins when the set cardinality reaches around 2^P \* 2.5. Polynomial regression has been used to calculate bias offsets BUT ONLY FOR P = 14. You are free to change the P value but the bias offsets will not be applied. [Check out the code for more information](https://github.com/joegreen0991/HyperLogLog/blob/master/src/HyperLogLog/Basic.php#L141)

### Some Professional Looking Graphs

[](#some-professional-looking-graphs)

\####HyperLogLog

*P=14*[![HyperLogLog P = 14](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/P14hll.png)](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/P14hll.png)

*P=16*Note the offset bias around 2.5 \* 2^16 ~= 165,000 [![HyerLogLog P = 16](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/p16hll.png)](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/p16hll.png)

*P=20*Note the offset bias around 2.5 \* 2^20 ~= 2,600,000 [![HyerLogLog P = 20](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/p20hll.png)](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/p20hll.png)

\####MinHash

*K=8192*[![MinHash K = 8129](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/minhask8192.png)](https://raw.githubusercontent.com/joegreen0991/HyperLogLog/master/errortest/img/minhask8192.png)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

4377d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3593b2ddeb932b3e7ac41221afd89becb377734b74416fcdb2114965c9f498a?d=identicon)[mrjgreen](/maintainers/mrjgreen)

---

Top Contributors

[![mrjgreen](https://avatars.githubusercontent.com/u/2183391?v=4)](https://github.com/mrjgreen "mrjgreen (30 commits)")

---

Tags

uniquehyperlogloghyper log logmin hashcardinalitiescardinality

### Embed Badge

![Health badge](/badges/joegreen0991-hyperloglog/health.svg)

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

###  Alternatives

[infocyph/uid

UUID (RFC 9562), ULID, Snowflake ID, Sonyflake ID, and TBSL generator for PHP.

116.0k](/packages/infocyph-uid)

PHPackages © 2026

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