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

What is the underying hashing function used?

arshbot opened this issue · comments

Hey there,

I don't see any information in the docs about the hashing fashion used here, could you provide some insight? Thanks!

It multiplies primes together to create a hash

def simple_hash(int_list, prime1, prime2, prime3):
"""Compute a hash value from a list of integers and 3 primes"""
result = 0
for integer in int_list:
result += ((result + integer + prime1) * prime2) % prime3
return result