Skip to content

Instantly share code, notes, and snippets.

@viveksyngh
Created May 20, 2019 19:04
Show Gist options
  • Save viveksyngh/9ef259b9da2e2a9848f6bbfda23fdaa9 to your computer and use it in GitHub Desktop.
Save viveksyngh/9ef259b9da2e2a9848f6bbfda23fdaa9 to your computer and use it in GitHub Desktop.
Bloom Filter Test
def test(item):
results = []
for hash_function in hash_functions:
index = hash_function(item) % m
if bit_array[index]:
results.append(True)
else:
results.append(False)
return reduce(lambda a, b : a & b, results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment