|
@@ -11,6 +11,7 @@ import math
|
|
|
import array
|
|
|
import random
|
|
|
|
|
|
+
|
|
|
def get_probes(bfilter, key):
|
|
|
'''Generate a bunch of fast hash functions'''
|
|
|
hasher = random.Random(key).randrange
|
|
@@ -19,6 +20,7 @@ def get_probes(bfilter, key):
|
|
|
bit_index = hasher(32)
|
|
|
yield array_index, 1 << bit_index
|
|
|
|
|
|
+
|
|
|
class Bloom_filter:
|
|
|
'''Probabilistic set membership testing for large sets'''
|
|
|
|