hiway / python-bloom-filter

Bloom filter for Python
https://pypi.org/project/bloom-filter/
82 stars 27 forks source link

Added functionality for users to pick a key function for their objects #10

Open 4gatepylon opened 4 years ago

4gatepylon commented 4 years ago

To make it easier to use a bloom filter for any type of object I added a 'key' parameter that you can use to insert data from some sort of object which may not be easily filtered by the current bloom filter implementation (i.e. floats). This way you don't need to externally store/do the mapping when using this package.

You use it by just passing in a key parameter that is default set to None (with None the bloom filter functions the same as it does right now).

Tests also added and passing.

Added a line in the readme to talk about this functionality.