#merge #insert #bias

hyperloglog

Hyperloglog implementation in Rust

15 releases (3 stable)

1.0.2 Jun 6, 2022
1.0.0 Dec 21, 2020
0.0.12 Nov 12, 2019
0.0.11 Jan 24, 2017
0.0.1 Nov 26, 2014

#726 in Algorithms

Download history 65/week @ 2023-11-29 83/week @ 2023-12-06 120/week @ 2023-12-13 40/week @ 2023-12-20 6/week @ 2023-12-27 69/week @ 2024-01-03 99/week @ 2024-01-10 82/week @ 2024-01-17 122/week @ 2024-01-24 111/week @ 2024-01-31 66/week @ 2024-02-07 118/week @ 2024-02-14 133/week @ 2024-02-21 150/week @ 2024-02-28 133/week @ 2024-03-06 101/week @ 2024-03-13

531 downloads per month

ISC license

115KB
4K SLoC

hyperloglog

A HyperLogLog implementation in Rust, with bias correction.

Installation: use Cargo:

[dependencies]
hyperloglog = "0"

Usage:

let mut hll = HyperLogLog::new(error_rate);
hll.insert(&"test1");
hll.insert(&"test2");
let card_estimation = hll.len();

let mut hll2 = HyperLogLog::new_from_template(&hll);
hll2.insert(&"test3");

hll.merge(&hll2);

Optional Cargo features:

  • with_serde: enable serialization via serde.

lib.rs:

HyperLogLog implementation for Rust

Dependencies

~340–580KB
~11K SLoC