HyperLogLog.net is a C# implementation of HyperLogLog - a near-optimal cardinality estimation algorithm.