-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Hello!
Please, add support 128bit hash (unsigned int)
from rbloom import Bloom
from xxhash import xxh3_128_intdigest
bf = Bloom(10_000, 0.01, xxh3_128_intdigest)
bf.add("hello") # Gives this error: OverflowError - int too big to convert I use next workaround as suggested in your example:
from rbloom import Bloom
from xxhash import xxh3_128_digest
def hash_func(obj):
hash_bytes = xxh3_128_digest(obj)
return int.from_bytes(hash_bytes, "big", signed=True)
bf = Bloom(10_000, 0.01, hash_func)
bf.add("hello")This works as expected.
But surely it shouldn't matter to a Bloom filter whether an integer between -2^127 and 2^127 is 1, or an unsigned integer? A workaround would add overhead.
Metadata
Metadata
Assignees
Labels
No labels