#bloom-filter #bloom

bloomy

A simple Bloom filter using only two hash functions

4 stable releases

1.2.0 Sep 13, 2022
1.1.0 Sep 13, 2022
1.0.1 Sep 13, 2022
1.0.0 Sep 11, 2022

#2319 in Data structures

Download history 1233/week @ 2024-07-21 784/week @ 2024-07-28 955/week @ 2024-08-04 1006/week @ 2024-08-11 869/week @ 2024-08-18 826/week @ 2024-08-25 945/week @ 2024-09-01 1000/week @ 2024-09-08 696/week @ 2024-09-15 1015/week @ 2024-09-22 1319/week @ 2024-09-29 1392/week @ 2024-10-06 1415/week @ 2024-10-13 1210/week @ 2024-10-20 1149/week @ 2024-10-27 1144/week @ 2024-11-03

5,040 downloads per month
Used in radicle-node

MIT license

315KB
653 lines

Bloomy

A minimal implementation of a Bloom filter in Rust.

Bloom filters are a space-efficient probabilistic data structure invented by Burton Howard Bloom in the 1970s.

This crate combines ideas and code from various other Bloom filter crates.

The underlying bit vector implementation is adapted from existing code by Helge Wrede, Alexander Schultheiß and Lukas Simon.

In comparison with other crates, bloomy combines the following advantages:

  • Computationally efficient by using a double hashing technique pioneered by Adam Kirsch and Michael Mitzenmacher. You can find a copy of the paper in the docs/ folder.
  • Has only a single dependency: siphasher, from which multiple hashers are derived, and hence doesn't depend on the bitvec or bit-vec crates.
  • Supports union and intersection operations.
  • Supports counting items and similarity metrics.

Usage

Add the following to your Cargo.toml:

[dependencies]
bloomy = "1"

Check the examples/ folder for usage examples.

License

Licensed under the MIT license.

Dependencies