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

#616 in Algorithms

Download history 374/week @ 2024-10-29 341/week @ 2024-11-05 319/week @ 2024-11-12 451/week @ 2024-11-19 247/week @ 2024-11-26 214/week @ 2024-12-03 286/week @ 2024-12-10 258/week @ 2024-12-17 79/week @ 2024-12-24 154/week @ 2024-12-31 317/week @ 2025-01-07 327/week @ 2025-01-14 349/week @ 2025-01-21 587/week @ 2025-01-28 593/week @ 2025-02-04 570/week @ 2025-02-11

2,163 downloads per month
Used in 2 crates

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

~350–580KB
~11K SLoC