1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
from __future__ import annotations
from typing import TYPE_CHECKING, Callable, Protocol
if TYPE_CHECKING:
from typing_extensions import Buffer, Self
class HashLike(Protocol):
"""Lifted from hashlib.pyi."""
@property
def digest_size(self) -> int: ...
@property
def block_size(self) -> int: ...
@property
def name(self) -> str: ...
def copy(self) -> Self: ...
def digest(self) -> bytes: ...
def hexdigest(self) -> str: ...
def update(self, data: Buffer, /) -> None: ...
SHAFunc = Callable[[], HashLike]
|