massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 3 / hashlib.pyi
1 # Stubs for hashlib\r
2 \r
3 import sys\r
4 from typing import AbstractSet, Optional, Union\r
5 \r
6 _DataType = Union[bytes, bytearray, memoryview]\r
7 \r
8 class _Hash(object):\r
9     digest_size = ...  # type: int\r
10     block_size = ...  # type: int\r
11 \r
12     # [Python documentation note] Changed in version 3.4: The name attribute has\r
13     # been present in CPython since its inception, but until Python 3.4 was not\r
14     # formally specified, so may not exist on some platforms\r
15     name = ...  # type: str\r
16 \r
17     def __init__(self, data: _DataType = ...) -> None: ...\r
18 \r
19     def copy(self) -> _Hash: ...\r
20     def digest(self) -> bytes: ...\r
21     def hexdigest(self) -> str: ...\r
22     def update(self, arg: _DataType) -> None: ...\r
23 \r
24 def md5(arg: _DataType = ...) -> _Hash: ...\r
25 def sha1(arg: _DataType = ...) -> _Hash: ...\r
26 def sha224(arg: _DataType = ...) -> _Hash: ...\r
27 def sha256(arg: _DataType = ...) -> _Hash: ...\r
28 def sha384(arg: _DataType = ...) -> _Hash: ...\r
29 def sha512(arg: _DataType = ...) -> _Hash: ...\r
30 \r
31 def new(name: str, data: _DataType = ...) -> _Hash: ...\r
32 \r
33 algorithms_guaranteed = ...  # type: AbstractSet[str]\r
34 algorithms_available = ...  # type: AbstractSet[str]\r
35 \r
36 def pbkdf2_hmac(hash_name: str, password: _DataType, salt: _DataType, iterations: int, dklen: Optional[int] = ...) -> bytes: ...\r
37 \r
38 if sys.version_info >= (3, 6):\r
39     class _VarLenHash(object):\r
40         digest_size = ...  # type: int\r
41         block_size = ...  # type: int\r
42         name = ...  # type: str\r
43 \r
44         def __init__(self, data: _DataType = ...) -> None: ...\r
45 \r
46         def copy(self) -> _VarLenHash: ...\r
47         def digest(self, length: int) -> bytes: ...\r
48         def hexdigest(self, length: int) -> str: ...\r
49         def update(self, arg: _DataType) -> None: ...\r
50 \r
51     sha3_224 = _Hash\r
52     sha3_256 = _Hash\r
53     sha3_384 = _Hash\r
54     sha3_512 = _Hash\r
55     shake_128 = _VarLenHash\r
56     shake_256 = _VarLenHash\r
57 \r
58     def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ...\r
59 \r
60     class _BlakeHash(_Hash):\r
61         MAX_DIGEST_SIZE = ...  # type: int\r
62         MAX_KEY_SIZE = ...  # type: int\r
63         PERSON_SIZE = ...  # type: int\r
64         SALT_SIZE = ...  # type: int\r
65 \r
66         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: ...\r
67 \r
68     blake2b = _BlakeHash\r
69     blake2s = _BlakeHash\r