Every item id is hashed with a 32-bit avalanching hash. The low bits of the hash pick one of m registers; the remaining bits are scanned for their longest run of leading zeros, ρ. Each register keeps only the largest ρ it has ever seen for its bucket — a single byte of state per bucket, no matter how many times that bucket is hit.
The cardinality estimate is the harmonic mean of 2^register across all m buckets, scaled by a bias-correction constant α_m:
E = α_m · m² / Σ 2^(-register[i])
- Small-range correction (linear counting) kicks in when the raw estimate is low and empty registers remain:
E = m · ln(m / zeros)
The "Repeat bias" slider controls how fast the underlying population of unique ids grows relative to the stream — low bias means almost every item is brand new, high bias means the stream keeps re-hitting a small pool, similar to a popular page getting repeat visits.