hiway / python-bloom-filter

Bloom filter for Python

Home Page:https://pypi.org/project/bloom-filter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support For Different Data Types

4gatepylon opened this issue · comments

I've tried to use this for floating point numbers and got a type error on line 403 for "mask = 1 << bit_within_wordno". It would be nice to support different data types such as floats by simply using the numerical values of the bytes (or some other mapping function specified by users).

Added PR for a minimal implementation of this that allows users to specify a key function that will map their key objects to something filterable of their choice.