hashlib: fix argument kinds, update for py39 (#4006)

* hashlib: add usedforsecurity in py39
* hashlib: fix positional-only args, arg names
* hashlib: fix positional and keyword only args for blake
* hashlib: add usedforsecurity to blake
This commit is contained in:
Shantanu
2020-05-16 16:31:12 -07:00
committed by GitHub
parent f56fdb99d1
commit 0a69743bca

View File

@@ -19,9 +19,16 @@ class _Hash(object):
def copy(self) -> _Hash: ...
def digest(self) -> bytes: ...
def hexdigest(self) -> str: ...
def update(self, arg: _DataType) -> None: ...
def update(self, __data: _DataType) -> None: ...
if sys.version_info >= (3, 8):
if sys.version_info >= (3, 9):
def md5(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha1(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha224(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha256(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha384(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha512(string: _DataType = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
elif sys.version_info >= (3, 8):
def md5(string: _DataType = ...) -> _Hash: ...
def sha1(string: _DataType = ...) -> _Hash: ...
def sha224(string: _DataType = ...) -> _Hash: ...
@@ -52,9 +59,9 @@ if sys.version_info >= (3, 6):
def __init__(self, data: _DataType = ...) -> None: ...
def copy(self) -> _VarLenHash: ...
def digest(self, length: int) -> bytes: ...
def hexdigest(self, length: int) -> str: ...
def update(self, arg: _DataType) -> None: ...
def digest(self, __length: int) -> bytes: ...
def hexdigest(self, __length: int) -> str: ...
def update(self, __data: _DataType) -> None: ...
sha3_224 = _Hash
sha3_256 = _Hash
@@ -71,7 +78,10 @@ if sys.version_info >= (3, 6):
PERSON_SIZE: int
SALT_SIZE: int
def __init__(self, data: _DataType = ..., digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ...
if sys.version_info >= (3, 9):
def __init__(self, __data: _DataType = ..., *, digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ..., usedforsecurity: bool = ...) -> None: ...
else:
def __init__(self, __data: _DataType = ..., *, digest_size: int = ..., key: _DataType = ..., salt: _DataType = ..., person: _DataType = ..., fanout: int = ..., depth: int = ..., leaf_size: int = ..., node_offset: int = ..., node_depth: int = ..., inner_size: int = ..., last_node: bool = ...) -> None: ...
blake2b = _BlakeHash
blake2s = _BlakeHash