Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0448109

Browse files
committed
fix type
1 parent 08bc970 commit 0448109

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data_structures/hashing/bloom_filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def format_bin(self, value):
4545

4646
def hash(self, value):
4747
res = 0b0
48-
for func in HASH_FUNCTIONS:
48+
for func in self.HASH_FUNCTIONS:
4949
b = func(value.encode()).digest()
5050
position = int.from_bytes(b, "little") % self.size
5151
res |= 2**position
@@ -77,7 +77,7 @@ def test_probability(m=64, n=20):
7777
for a in added:
7878
b.add(a)
7979

80-
k = len(b.HASH_FUNCIONS)
80+
k = len(b.HASH_FUNCTIONS)
8181

8282
n_ones = bin(b.bitstring).count("1")
8383
expected_probability = (n_ones / m) ** k

0 commit comments

Comments
 (0)