Skip to content
Python bindings for C implementation of xorfilter(faster and smaller than bloom and cuckoo filters)
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Initial commit Dec 25, 2019
pyxorfilter Code cleanup Dec 25, 2019
.gitignore Code cleanup Dec 25, 2019
.gitmodules
LICENSE Initial commit Dec 25, 2019
README.md Readme.md: fix a typo in the git invocation Jan 12, 2020
setup.cfg
setup.py Code cleanup Dec 25, 2019

README.md

pyxorfilter

Python bindings for C implementation of Xor Filters: Faster and Smaller Than Bloom and Cuckoo Filters

Installation

From Source

git clone --recurse-submodules https://github.com/GreyDireWolf/pyxorfilter
cd pyxorfilter
python setup.py build_ext
python setup.py install

Usage

>>> from pyxorfilter import Xor8, Xor16
>>> filter = Xor8(100)	#or Xor16(size)
>>> filter.populate([_ for _ in range(100)])
True
>>> filter.contains(90)
True
>>> filter.contains(150)
False
>>> filter.size_in_bytes()
177

Caveats

Overflow

Both Xor8 and Xor16 take uint8_t and uint_16t respectively. Make sure that the input is unsigned.

TODO

  • Add unit tests and benchmarks
  • Add CI support for distributing pyxorfilter with PyPI.

Links

You can’t perform that action at this time.