Skip to main content

Binary Fuse Filter

A fast and space-efficient Binary Fuse Filter implementation in Rust with Python bindings. Based on the paper "Binary Fuse Filters: Fast and Smaller Than Xor Filters" by Daniel Lemire et al.

Binary Fuse Filters are approximate set membership structures (like Bloom filters) but are smaller and faster for lookups. They are particularly effective when the set of keys is known in advance (static filters).

Features

  • High Performance: Implementation in Rust for maximum speed.
  • Space Efficient: Only ~1.15x overhead over the theoretical minimum (better than Bloom/Xor filters).
  • Python Bindings: Easy to use from Python with BinaryFuse8 (8-bit fingerprints, ~0.4% FPR) and BinaryFuse16 (16-bit fingerprints, ~0.0015% FPR).
  • Serialization: Full support for Python's pickle module.

Installation

pip install binaryfuse

Usage (Python)

from binary_fuse import BinaryFuse8

# List of integer keys
keys = [1, 2, 3, 100, 200, 300]

# Build the filter
bf = BinaryFuse8(keys)

# Check membership
print(1 in bf)    # True
print(101 in bf)  # False (most likely)

# Serialization
import pickle
data = pickle.dumps(bf)
bf2 = pickle.loads(data)
print(1 in bf2)   # True

Compatibility & Zero-Compile Installation

We ship abi3 wheels (Stable ABI), which means:

  • One binary works everywhere: A single wheel supports all Python versions from 3.8 to 3.13+.
  • No compilation needed: Works out-of-the-box on Linux (glibc/musl), macOS (Intel/Apple Silicon), and Windows.
  • Future-proof: The wheel you install today will likely work on Python 3.14+ without any updates.

Technical Details

Binary Fuse Filters use a fused segment layout where each key is mapped to three locations ($h_0, h_1, h_2$) in a linear array. The locations are chosen from overlapping segments, which improves the success rate of the construction algorithm compared to standard Xor filters.

This implementation uses:

  • Arity 3: Each key maps to 3 locations.
  • 32 Segments: Standard for modern Binary Fuse Filter implementations.
  • Hashing: Robust mixing of 64-bit hashes to ensure uniform distribution.

Comparative Results (100,000 keys)

Filter Build (s) Hit (s) Miss (s) FPR (%) Size (KB) Bits/Key
BinaryFuse8 (Ours) 0.0170 0.0029 0.0032 0.37% 131.0 10.7
BinaryFuse16 (Ours) 0.0132 0.0029 0.0030 0.00% 262.0 21.4
rbloom (Rust Bloom) 0.0053 0.0019 0.0026 1.00% 117.0 9.6
Fuse8 (Lemire C) 0.0195 0.0203 0.0206 0.40% 1056.0* N/A
pybloom-live (Py) 0.0915 0.0829 0.0602 0.99% 117.3 9.6

* Note: Some C-binding sizes (like Fuse8) are estimated via RSS delta and may be inaccurate.

Why use Binary Fuse Filter?

While standard Bloom filters (like rbloom) are slightly faster for lookups (~20ns vs ~30ns), Binary Fuse Filters are significantly more space-efficient for the same accuracy.

  • Accuracy vs Size: For roughly the same memory (~120-130KB), our BinaryFuse8 offers 0.37% False Positive Rate, while the Bloom filter has 1.00% error. You get 2.7x better accuracy for the same cost.
  • To match our accuracy: A Bloom filter would need ~11.5 bits/key, making it ~20% larger than our filter.
  • Immutability: Binary Fuse filters are static. If you need to add items incrementally, use a Bloom filter. If you have a static dataset (e.g., a daily blocklist, a dictionary), Binary Fuse is mathematically superior.

Thread Safety

Our implementation is thread-safe for concurrent lookups. Because the filter is immutable after construction, multiple Python threads can perform membership tests (key in bf) simultaneously. The underlying Rust logic does not require any write locks or synchronization, making it ideal for high-concurrency environments.

License

MIT

Release files for binaryfuse 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binaryfuse 0.1.2
File Size Uploaded
binaryfuse-0.1.2.tar.gz 12.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for binaryfuse 0.1.2
File
binaryfuse-0.1.2-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
binaryfuse-0.1.2-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.8 abi3 Linux glibc 2.17+ IBM System/390x Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.8 abi3 Linux glibc 2.17+ PowerPC 64-le Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.8 abi3 Linux glibc 2.17+ ARMv7l Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
binaryfuse-0.1.2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl CPython 3.8 abi3 Linux glibc 2.5+ x86-32 Details
binaryfuse-0.1.2-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
binaryfuse-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size:2.7 MB

Release files / binaryfuse-0.1.2.tar.gz

Download URL binaryfuse-0.1.2.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bd8ee2838bdc2cd2a288a27de8973393ab73ecc1a98fde67e03c3f6ba525882b
BLAKE2b-256 checksum
How to use checksums
3fb791c6bc0df6107e0db543c564758f922fb5075d0ae89381f54621e3e5c5c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-win_amd64.whl

Download URL binaryfuse-0.1.2-cp38-abi3-win_amd64.whl
Size 168.1 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9dbc8bf28b2a2b2d9463c651a23274ff7aa24017b4d47f9f37af9de1075e6ad1
BLAKE2b-256 checksum
How to use checksums
65ce35ebf4e9e8a15c8679f72ff1c9d7db353807e8f18d281b19703cbaf3b3a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-win32.whl

Download URL binaryfuse-0.1.2-cp38-abi3-win32.whl
Size 162.0 kB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
ac26672c21a2ab2e2cdef3c4ee06b67aec8d1d91c76437fae547109c1e26791a
BLAKE2b-256 checksum
How to use checksums
1a710cc90f2eab14985f95858ff1b7f543e3f600b5e9778ab2df1eda1b0d3a04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 288.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8d75945d088fd471fbc1cf7a70809fdb99d8072addc94ce5188a6f5de9e3d723
BLAKE2b-256 checksum
How to use checksums
5a02ad761013120e66b1897048c3d11a96fd23d4a61f22e6f7be177b1d90d55e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 334.0 kB
Tags CPython 3.8 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
66ec17cbfec3ece3bf757a5b1f8ff0c6b972ef3b446203753e27518c62b21d1b
BLAKE2b-256 checksum
How to use checksums
d30fbd21bcb2a119e241a11ebb53faf9fe2cd0558bdb667f072a6ef20ad56edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 318.3 kB
Tags CPython 3.8 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
69ad95350a8b4e81b27243aeef5447c2a7d5a7d14cf59c78d6e69aa90baf76c7
BLAKE2b-256 checksum
How to use checksums
c49f1eb35d600b410165ac8c1f001dfd44022a8eae12726813e8a3b993b32a3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 298.2 kB
Tags CPython 3.8 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
30b927d929b920cf3c83d4af19e0db67aa196da1b42d092242d1de80d6720dcd
BLAKE2b-256 checksum
How to use checksums
4d690914c18921d75196d0d43f2e53f8dac436b231ee42d10ab9aca93ae79d1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 285.9 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
05789af3bf6749e830f9abb1dea7a3badc9003319c1c4baaa5bd4547aad1cc9f
BLAKE2b-256 checksum
How to use checksums
35bddd4ab51e56ce386241b47626d2f90564a0a969d03c765133cd607352ac70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl

Download URL binaryfuse-0.1.2-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Size 310.6 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-32 abi3
SHA-256 checksum
How to use checksums
ee5c958c2a2824b2536615ab9a9300e759508945117a2399006c510abebd09af
BLAKE2b-256 checksum
How to use checksums
db0dc2c5e036880a5a19ea42cbe4d97e92be60dd115a1e2de327e6a473d08aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-macosx_11_0_arm64.whl

Download URL binaryfuse-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
Size 262.1 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c525f31a493d53cccc48554574a9e219d77c2c547ca0f9415655b8052e5265f3
BLAKE2b-256 checksum
How to use checksums
49a13df35c369d356dc1c40ecbe75b3fad0c7560577c6af62a7ef23ff71200a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release files / binaryfuse-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl

Download URL binaryfuse-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl
Size 271.9 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b53010d30604355e5a0350c357c885e6f85e5110d98934484733fb069f681cd0
BLAKE2b-256 checksum
How to use checksums
7fe7848d044d6cded70a251f862a2faff6d5c37118bd1aeeb992d15b41a2ca09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

11 release files

0.1.1

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page