An implementation of HyperLogLog written in Go. HyperLogLog is a cardinality estimation algorithm explained well here.
hllInstance := NewHLLWithRegisterBits(numRegisterBits)
Note: defaults to 6 register bits if not explicitly specified
hllInstance.AddString("hello")
hllInstance.AddHash(123456)
Under the hood, AddString
uses MurmurHash32
to hash the provided string into a 32 bit integer.
count := hllInstance.Count()
hllInstance.Merge(otherHllInstance)
go test
All code is formatted with go fmt