mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-24 09:48:39 +08:00
Improve passlib.win32 (#13711)
This commit is contained in:
@@ -32,7 +32,6 @@ passlib.utils.decor.__all__
|
||||
passlib.utils.handlers.__all__
|
||||
passlib.utils.md4.__all__
|
||||
passlib.utils.pbkdf2.__all__
|
||||
passlib.win32.__all__
|
||||
|
||||
# proxy module that uses some import magic incompatible with stubtest
|
||||
passlib.hash
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any, ClassVar
|
||||
from typing import Any, ClassVar, Literal, overload
|
||||
|
||||
import passlib.utils.handlers as uh
|
||||
|
||||
@@ -17,8 +17,15 @@ class nthash(uh.StaticHandler):
|
||||
checksum_size: ClassVar[int]
|
||||
@classmethod
|
||||
def raw(cls, secret): ...
|
||||
@overload
|
||||
@classmethod
|
||||
def raw_nthash(cls, secret, hex: bool = False): ...
|
||||
def raw_nthash(cls, secret: str | bytes, hex: Literal[True]) -> str: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def raw_nthash(cls, secret: str | bytes, hex: Literal[False] = False) -> bytes: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def raw_nthash(cls, secret: str | bytes, hex: bool = False) -> str | bytes: ...
|
||||
|
||||
bsd_nthash: Any
|
||||
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
from typing import Any
|
||||
from binascii import hexlify as hexlify
|
||||
from typing import Final, Literal, overload
|
||||
|
||||
from passlib.hash import nthash as nthash
|
||||
from passlib.handlers.windows import nthash as nthash
|
||||
|
||||
raw_nthash: Any
|
||||
LM_MAGIC: Final[bytes]
|
||||
raw_nthash = nthash.raw_nthash
|
||||
|
||||
def raw_lmhash(secret, encoding: str = "ascii", hex: bool = False): ...
|
||||
@overload
|
||||
def raw_lmhash(secret: str | bytes, encoding: str = "ascii", hex: Literal[False] = False) -> bytes: ...
|
||||
@overload
|
||||
def raw_lmhash(secret: str | bytes, encoding: str, hex: Literal[True]) -> str: ...
|
||||
@overload
|
||||
def raw_lmhash(secret: str | bytes, *, hex: Literal[True]) -> str: ...
|
||||
|
||||
__all__ = ["nthash", "raw_lmhash", "raw_nthash"]
|
||||
|
||||
Reference in New Issue
Block a user