An implemantation of quotient filter. Based on the book named Algorithms and Data Structures for Massive Datasets.
To use this crate, simply add the following string to your Cargo.toml
:
quotient-filter = "0.2.0"
```rust
let mut filter = QuotientFilter::new(5).unwrap();
// if method names end with 'value', it uses fnv1a as default
let idx = filter.insertvalue(&1u8.tobebytes()).unwrap(); // returns Result
// The generic one doesn't have default hashes.
let mut filter_generic = QuotientFilter::<u64>::new(2).unwrap();
let idx3 = filter.insert(your_u64_hash_result).unwrap();
```
Supports insertion, deletion, lookup, merging and resizing.
The generic version exists under the generic module. It was first implemented for u64, then mostly copy pasted u32 version under extra module. To avoid of copy-paste, the generic version is created but decided not to delete old ones. It supports u64, u32, u16 and u8.