From a2622de9230af8542708fcb212c51f458feb834a Mon Sep 17 00:00:00 2001 From: barrust Date: Fri, 27 Dec 2024 00:26:54 -0500 Subject: [PATCH] more changes --- probables/cuckoo/countingcuckoo.py | 4 +--- probables/hashes.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/probables/cuckoo/countingcuckoo.py b/probables/cuckoo/countingcuckoo.py index 5db9e97..aec808d 100644 --- a/probables/cuckoo/countingcuckoo.py +++ b/probables/cuckoo/countingcuckoo.py @@ -99,9 +99,7 @@ def init_error_rate( return cku @classmethod - def load_error_rate( - cls, error_rate: float, filepath: str | Path, hash_function: SimpleHashT | None = None - ): + def load_error_rate(cls, error_rate: float, filepath: str | Path, hash_function: SimpleHashT | None = None): """Initialize a previously exported Cuckoo Filter based on error rate Args: diff --git a/probables/hashes.py b/probables/hashes.py index 0a1533a..f2080b8 100644 --- a/probables/hashes.py +++ b/probables/hashes.py @@ -5,11 +5,11 @@ from functools import wraps from hashlib import md5, sha256 from struct import unpack -from typing import Callable +from typing import Callable, Union from probables.constants import UINT32_T_MAX, UINT64_T_MAX -KeyT = str | bytes +KeyT = Union[str, bytes] SimpleHashT = Callable[[KeyT, int], int] HashResultsT = list[int] HashFuncT = Callable[[KeyT, int], HashResultsT]