#bloom-filter #bloom #filter #bit-vector

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

#1873 in Data structures

Download history 1303/week @ 2023-12-13 1500/week @ 2023-12-20 790/week @ 2023-12-27 1520/week @ 2024-01-03 1735/week @ 2024-01-10 1428/week @ 2024-01-17 942/week @ 2024-01-24 838/week @ 2024-01-31 1239/week @ 2024-02-07 965/week @ 2024-02-14 984/week @ 2024-02-21 777/week @ 2024-02-28 1024/week @ 2024-03-06 935/week @ 2024-03-13 876/week @ 2024-03-20 1317/week @ 2024-03-27

4,270 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