Skip to main content

Portable, cross language Bloom Fitler implementation, with compatible libraries in Java and Go

Project description

Package inbloom implements a portable bloom filter that can export and import data to and from implementations of the same library in different languages.

This implementation is a C extension which wraps libbloom (https://github.com/jvirkki/libbloom)

Installation

pip install inbloom

Usage

import inbloom

bf = inbloom.Filter(entries=100, error=0.01)
bf.add("abc")
bf.add("def")

assert bf.contains("abc")
assert bf.contains("def")
assert not bf.contains("ghi")

bf2 = inbloom.Filter(entries=100, error=0.01, data=bf.buffer())
assert bf2.contains("abc")
assert bf2.contains("def")
assert not bf2.contains("ghi")

Serialization

import inbloom
import binascii

payload = '620d006400000014000000000020001000080000000000002000100008000400'
assert binascii.hexlify(inbloom.dump(inbloom.load(binascii.unhexlify(payload)))) == payload

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inbloom-0.2.2.tar.gz (11.8 kB view details)

Uploaded Source

File details

Details for the file inbloom-0.2.2.tar.gz.

File metadata

  • Download URL: inbloom-0.2.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for inbloom-0.2.2.tar.gz
Algorithm Hash digest
SHA256 29944976260b7dfb3c679722a98a40da86a846eed703d65c37db4691280148fc
MD5 f95edf7c8588c75f1fefc21ce3984115
BLAKE2b-256 f4c6bfa2b9c6769fed0dcfe008e5f3a9f03527135e4abe545054c69ead95072b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page