@@ -72,11 +72,11 @@ def __init__(self, size: int = 8) -> None:
72
72
self .size = size
73
73
74
74
def add (self , value : str ) -> None :
75
- h = self .hash (value )
75
+ h = self .hash_ (value )
76
76
self .bitarray |= h
77
77
78
78
def exists (self , value : str ) -> bool :
79
- h = self .hash (value )
79
+ h = self .hash_ (value )
80
80
return (h & self .bitarray ) == h
81
81
82
82
def __contains__ (self , other : str ) -> bool :
@@ -87,10 +87,10 @@ def format_bin(self, bitarray: int) -> str:
87
87
return res .zfill (self .size )
88
88
89
89
@property
90
- def bitstring (self ) -> None :
90
+ def bitstring (self ) -> str :
91
91
return self .format_bin (self .bitarray )
92
92
93
- def hash (self , value : str ) -> int :
93
+ def hash_ (self , value : str ) -> int :
94
94
res = 0b0
95
95
for func in HASH_FUNCTIONS :
96
96
b = func (value .encode ()).digest ()
@@ -99,7 +99,7 @@ def hash(self, value: str) -> int:
99
99
return res
100
100
101
101
def format_hash (self , value : str ) -> str :
102
- return self .format_bin (self .hash (value ))
102
+ return self .format_bin (self .hash_ (value ))
103
103
104
104
def estimated_error_rate (self ) -> float :
105
105
n_ones = bin (self .bitarray ).count ("1" )
0 commit comments