tesser.cardinality

Cardinality estimate digest using HyperLogLog+. For examples, check tesser.math/digest.

from-byte-array

(from-byte-array bs)

Convert a ByteArray into an HLL estimator instance.

hll

(hll)(hll {:keys [p sp]})

Construct a new HLL cardinality estimator based on the improved HyperLogLog+ algorithm which features sparse sets and bias correction. Optionally accepts an options map with keys:

:p - Precision for the Normal set representation. :sp - Precision for the Sparse set representation.

For the sparse representation: :p must be a value between 4 and :sp :sp must be less than 32.

For old behaviour: :sp must be set to 0.

Default: :p 16, :sp 0

to-byte-array

(to-byte-array hll)

Convert the HLL estimator to a ByteArray