Skip to content

Commit

Permalink
use type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
barrust committed Dec 24, 2024
1 parent 7f06b1c commit 8311f41
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions probables/hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from functools import wraps
from hashlib import md5, sha256
from struct import unpack
from typing import Callable, List, Union
from typing import Callable, List, TypeAlias, Union

from probables.constants import UINT32_T_MAX, UINT64_T_MAX

KeyT = Union[str, bytes]
SimpleHashT = Callable[[KeyT, int], int]
HashResultsT = List[int]
HashFuncT = Callable[[KeyT, int], HashResultsT]
HashFuncBytesT = Callable[[KeyT, int], bytes]
KeyT: TypeAlias = Union[str, bytes]
SimpleHashT: TypeAlias = Callable[[KeyT, int], int]
HashResultsT: TypeAlias = List[int]
HashFuncT: TypeAlias = Callable[[KeyT, int], HashResultsT]
HashFuncBytesT: TypeAlias = Callable[[KeyT, int], bytes]


def hash_with_depth_bytes(func: HashFuncBytesT) -> HashFuncT:
Expand Down

0 comments on commit 8311f41

Please sign in to comment.