File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class Bloom:
10
10
# number of hash functions is fixed
11
11
HASH_FUNCTIONS = (sha256 , md5 )
12
12
13
- def __init__ (self , size = 8 ) :
13
+ def __init__ (self , size : int = 8 ) -> None :
14
14
self .bitstring = 0b0
15
15
self .size = size
16
16
@@ -52,7 +52,7 @@ def hash_(self, value: str) -> int:
52
52
return res
53
53
54
54
55
- def test_movies ():
55
+ def test_movies () -> None :
56
56
b = Bloom ()
57
57
b .add ("Titanic" )
58
58
b .add ("Avatar" )
@@ -66,11 +66,11 @@ def test_movies():
66
66
assert b .exists ("Pulp Fiction" ) in (True , False )
67
67
68
68
69
- def random_string (size ) :
69
+ def random_string (size : int ) -> str :
70
70
return "" .join (choices (ascii_lowercase + " " , k = size ))
71
71
72
72
73
- def test_probability (m = 64 , n = 20 ):
73
+ def test_probability (m : int = 64 , n : int = 20 ) -> None :
74
74
b = Bloom (size = m )
75
75
76
76
k = len (b .HASH_FUNCTIONS )
You can’t perform that action at this time.
0 commit comments