forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinascii.pyi
More file actions
44 lines (33 loc) · 1.66 KB
/
binascii.pyi
File metadata and controls
44 lines (33 loc) · 1.66 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
import sys
from _typeshed import ReadableBuffer
from typing_extensions import TypeAlias
# Many functions in binascii accept buffer objects
# or ASCII-only strings.
_AsciiBuffer: TypeAlias = str | ReadableBuffer
def a2b_uu(__data: _AsciiBuffer) -> bytes: ...
if sys.version_info >= (3, 7):
def b2a_uu(__data: ReadableBuffer, *, backtick: bool = ...) -> bytes: ...
else:
def b2a_uu(__data: ReadableBuffer) -> bytes: ...
def a2b_base64(__data: _AsciiBuffer) -> bytes: ...
def b2a_base64(__data: ReadableBuffer, *, newline: bool = ...) -> bytes: ...
def a2b_qp(data: _AsciiBuffer, header: bool = ...) -> bytes: ...
def b2a_qp(data: ReadableBuffer, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ...
if sys.version_info < (3, 11):
def a2b_hqx(__data: _AsciiBuffer) -> bytes: ...
def rledecode_hqx(__data: ReadableBuffer) -> bytes: ...
def rlecode_hqx(__data: ReadableBuffer) -> bytes: ...
def b2a_hqx(__data: ReadableBuffer) -> bytes: ...
def crc_hqx(__data: ReadableBuffer, __crc: int) -> int: ...
def crc32(__data: ReadableBuffer, __crc: int = ...) -> int: ...
if sys.version_info >= (3, 8):
# sep must be str or bytes, not bytearray or any other buffer
def b2a_hex(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ...
def hexlify(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ...
else:
def b2a_hex(__data: ReadableBuffer) -> bytes: ...
def hexlify(__data: ReadableBuffer) -> bytes: ...
def a2b_hex(__hexstr: _AsciiBuffer) -> bytes: ...
def unhexlify(__hexstr: _AsciiBuffer) -> bytes: ...
class Error(ValueError): ...
class Incomplete(Exception): ...