File: crypt.pyi

package info (click to toggle)
typeshed 0.0~git20260204.516eed0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 32,220 kB
  • sloc: python: 9,096; makefile: 21; sh: 18
file content (26 lines) | stat: -rw-r--r-- 792 bytes parent folder | download | duplicates (2)
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
import sys
from typing import Final, NamedTuple, type_check_only
from typing_extensions import disjoint_base

if sys.platform != "win32":
    @type_check_only
    class _MethodBase(NamedTuple):
        name: str
        ident: str | None
        salt_chars: int
        total_size: int

    if sys.version_info >= (3, 12):
        class _Method(_MethodBase): ...
    else:
        @disjoint_base
        class _Method(_MethodBase): ...

    METHOD_CRYPT: Final[_Method]
    METHOD_MD5: Final[_Method]
    METHOD_SHA256: Final[_Method]
    METHOD_SHA512: Final[_Method]
    METHOD_BLOWFISH: Final[_Method]
    methods: list[_Method]
    def mksalt(method: _Method | None = None, *, rounds: int | None = None) -> str: ...
    def crypt(word: str, salt: str | _Method | None = None) -> str: ...