File: _protocols.py

package info (click to toggle)
python-passlib 1.9.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,184 kB
  • sloc: python: 26,132; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 562 bytes parent folder | download
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]