forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashlib.pyi
More file actions
123 lines (109 loc) · 4.1 KB
/
Copy pathhashlib.pyi
File metadata and controls
123 lines (109 loc) · 4.1 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import sys
from _typeshed import ReadableBuffer
from typing import AbstractSet, Optional
class _Hash(object):
digest_size: int
block_size: int
# [Python documentation note] Changed in version 3.4: The name attribute has
# been present in CPython since its inception, but until Python 3.4 was not
# formally specified, so may not exist on some platforms
name: str
def __init__(self, data: ReadableBuffer = ...) -> None: ...
def copy(self) -> _Hash: ...
def digest(self) -> bytes: ...
def hexdigest(self) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
if sys.version_info >= (3, 9):
def md5(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha1(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha224(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha256(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha384(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
def sha512(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
elif sys.version_info >= (3, 8):
def md5(string: ReadableBuffer = ...) -> _Hash: ...
def sha1(string: ReadableBuffer = ...) -> _Hash: ...
def sha224(string: ReadableBuffer = ...) -> _Hash: ...
def sha256(string: ReadableBuffer = ...) -> _Hash: ...
def sha384(string: ReadableBuffer = ...) -> _Hash: ...
def sha512(string: ReadableBuffer = ...) -> _Hash: ...
else:
def md5(__string: ReadableBuffer = ...) -> _Hash: ...
def sha1(__string: ReadableBuffer = ...) -> _Hash: ...
def sha224(__string: ReadableBuffer = ...) -> _Hash: ...
def sha256(__string: ReadableBuffer = ...) -> _Hash: ...
def sha384(__string: ReadableBuffer = ...) -> _Hash: ...
def sha512(__string: ReadableBuffer = ...) -> _Hash: ...
def new(name: str, data: ReadableBuffer = ...) -> _Hash: ...
algorithms_guaranteed: AbstractSet[str]
algorithms_available: AbstractSet[str]
def pbkdf2_hmac(
hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: Optional[int] = ...
) -> bytes: ...
class _VarLenHash(object):
digest_size: int
block_size: int
name: str
def __init__(self, data: ReadableBuffer = ...) -> None: ...
def copy(self) -> _VarLenHash: ...
def digest(self, __length: int) -> bytes: ...
def hexdigest(self, __length: int) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
sha3_224 = _Hash
sha3_256 = _Hash
sha3_384 = _Hash
sha3_512 = _Hash
shake_128 = _VarLenHash
shake_256 = _VarLenHash
def scrypt(
password: ReadableBuffer,
*,
salt: Optional[ReadableBuffer] = ...,
n: Optional[int] = ...,
r: Optional[int] = ...,
p: Optional[int] = ...,
maxmem: int = ...,
dklen: int = ...,
) -> bytes: ...
class _BlakeHash(_Hash):
MAX_DIGEST_SIZE: int
MAX_KEY_SIZE: int
PERSON_SIZE: int
SALT_SIZE: int
if sys.version_info >= (3, 9):
def __init__(
self,
__data: ReadableBuffer = ...,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
salt: ReadableBuffer = ...,
person: ReadableBuffer = ...,
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: ReadableBuffer = ...,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
salt: ReadableBuffer = ...,
person: ReadableBuffer = ...,
fanout: int = ...,
depth: int = ...,
leaf_size: int = ...,
node_offset: int = ...,
node_depth: int = ...,
inner_size: int = ...,
last_node: bool = ...,
) -> None: ...
blake2b = _BlakeHash
blake2s = _BlakeHash