maximal / hyperloglog
Set cardinality estimator using the HyperLogLog algorithm
v1.0
2026-10-16 11:05 UTC
Requires
- php: >=8.4
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Set cardinality estimator using the HyperLogLog algorithm.
Installation
Install the library using Composer:
composer require maximal/hyperloglog
Usage
Add items to the HyperLogLog instance and count the unique items:
$hll = new HyperLogLog(); $hll->add('foo'); $hll->add('bar'); $hll->add('baz'); $hll->add('foo'); $hll->add('baz'); echo 'Unique items: ', $hll->count(), PHP_EOL; // Unique items: 3