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.1.tar.gz (11.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for inbloom-0.2.1.tar.gz
Algorithm Hash digest
SHA256 42c761fce0ca2922ab4913cd7e0c01046d7d798ecfee4131a21300ced3e0c0b2
MD5 bedaeaafe8e05aba2f22487b6bf05e77
BLAKE2b-256 2c68d12a34834c854b26c021020f191917bbdf51f66c49a9990281c0224eeea7

See more details on using hashes here.

Supported by

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