Creates a new HyperLogLog instance.
Optional
p: number = 4The log2(m) parameter, where m is the number of registers. Must be an integer between 4 and 30 (inclusive).
Adds an element to the HyperLogLog.
The element to add.
Merges another HyperLogLog instance into this instance. Both instances must have the same number of registers.
Another HLL instance to merge.
A HyperLogLog implementation in TypeScript for estimating the cardinality of a set.
HyperLogLog is a probabilistic data structure used to estimate the number of distinct elements in a multiset using a small, fixed amount of memory.
This enhanced version includes options for merging HLLs, configuring accuracy, and optimized zero-count and hash functions.
See
https://en.wikipedia.org/wiki/HyperLogLog