A fast bloom filter implemented by Rust for Python!
Project description
fastbloom
A fast bloom filter implemented by Rust for Python!
benchmark
bloom add
|
|
Additional Statistics:
Lower bound | Estimate | Upper bound | |
---|---|---|---|
Slope | 41.095 ns | 41.146 ns | 41.203 ns |
R² | 0.9959495 | 0.9961648 | 0.9959083 |
Mean | 41.157 ns | 41.207 ns | 41.257 ns |
Std. Dev. | 226.07 ps | 261.59 ps | 294.01 ps |
Median | 41.132 ns | 41.184 ns | 41.247 ns |
MAD | 201.13 ps | 277.13 ps | 335.05 ps |
Python
requirements
Python >= 3.7
setup
Install the latest fastbloom version with:
pip install fastbloom-rs
Examples
for python
from fastbloom_rs import BloomFilter
bloom = BloomFilter(100_000_000, 0.01)
bloom.add_str('hello')
bloom.add_bytes(b'world')
bloom.add_int(9527)
assert bloom.contains('hello')
assert bloom.contains(b'world')
assert bloom.contains(9527)
assert not bloom.contains('hello world')
for rust
use fastbloom_rs::{BloomFilter, FilterBuilder};
let mut bloom = FilterBuilder::new(100_000_000, 0.01).build_bloom_filter();
bloom.add(b"helloworld");
assert_eq!(bloom.contains(b"helloworld"), true);
assert_eq!(bloom.contains(b"helloworld!"), false);
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastbloom_rs-0.1.1.tar.gz
(39.1 kB
view hashes)
Built Distributions
Close
Hashes for fastbloom_rs-0.1.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae0c18821fcc0e848667f5e7607601443c4017e55696018a19b7be5aa5d9ab1 |
|
MD5 | 3ec4fb2cff808a213f28ee156429859a |
|
BLAKE2b-256 | 816d85af64aa83b539c6b89a4fac441e5d411fa3237316b2b9341a2e2d461e82 |
Close
Hashes for fastbloom_rs-0.1.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa396a5996fe6a7f6c0eec9caad7c8bc2b3317c45b1109b3f23b4f5ca360d65a |
|
MD5 | 7003e4a98163bfa59ad05e28673a83e4 |
|
BLAKE2b-256 | 3f6d6c2f9db5a4f6f6bfe1d2c06aa3f343e0422cd1f5f1a98b66b08149261ef1 |
Close
Hashes for fastbloom_rs-0.1.1-cp37-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7f29c569a65b9059e3fa896c5eeb2fa833c4300b55e4c9b378e500af3919000 |
|
MD5 | 96894e63faa7f482f898f30c827c04aa |
|
BLAKE2b-256 | 2049a77f32f9e792177c4d0393045c35b6c7b6053ba567b7237b3e5ece5713dd |
Close
Hashes for fastbloom_rs-0.1.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cfe10c2171b678e13428afd5c1b73f93d8678696b133981249da09a9f0594d9 |
|
MD5 | 496e4eeb3dfacc70db67529bb00ced80 |
|
BLAKE2b-256 | b5cda7c5d7e82ba382e929e9ca83c0cd96d4dc9c94e3ee05e0102ca3f00969cb |
Close
Hashes for fastbloom_rs-0.1.1-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942922764e9b881e9db3b49901ad9a9617d3315b133d63edced3b4dfae5af308 |
|
MD5 | 6234317190d2648d0aca4d2515905bab |
|
BLAKE2b-256 | 8e11ab7814e45061dcbe92a453f44e45f4dce6bdeebc90c816a348f62a0f4d9d |