Debian Codegraph @

jedi/third_party/typeshed/stdlib/binascii.pyi

raw symbols SCIP
1 import sys
2 from _typeshed import ReadableBuffer
3 from typing_extensions import TypeAlias, deprecated
4
5 # Many functions in binascii accept buffer objects
6 # or ASCII-only strings.
7 _AsciiBuffer: TypeAlias = str | ReadableBuffer
8
9 def a2b_uu(data: _AsciiBuffer, /) -> bytes: ...
10 def b2a_uu(data: ReadableBuffer, /, *, backtick: bool = False) -> bytes: ...
11
12 if sys.version_info >= (3, 11):
13 def a2b_base64(data: _AsciiBuffer, /, *, strict_mode: bool = False) -> bytes: ...
14
15 else:
16 def a2b_base64(data: _AsciiBuffer, /) -> bytes: ...
17
18 def b2a_base64(data: ReadableBuffer, /, *, newline: bool = True) -> bytes: ...
19 def a2b_qp(data: _AsciiBuffer, header: bool = False) -> bytes: ...
20 def b2a_qp(data: ReadableBuffer, quotetabs: bool = False, istext: bool = True, header: bool = False) -> bytes: ...
21
22 if sys.version_info < (3, 11):
23 @deprecated("Deprecated since Python 3.9; removed in Python 3.11.")
24 def a2b_hqx(data: _AsciiBuffer, /) -> bytes: ...
25 @deprecated("Deprecated since Python 3.9; removed in Python 3.11.")
26 def rledecode_hqx(data: ReadableBuffer, /) -> bytes: ...
27 @deprecated("Deprecated since Python 3.9; removed in Python 3.11.")
28 def rlecode_hqx(data: ReadableBuffer, /) -> bytes: ...
29 @deprecated("Deprecated since Python 3.9; removed in Python 3.11.")
30 def b2a_hqx(data: ReadableBuffer, /) -> bytes: ...
31
32 def crc_hqx(data: ReadableBuffer, crc: int, /) -> int: ...
33 def crc32(data: ReadableBuffer, crc: int = 0, /) -> int: ...
34 def b2a_hex(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = 1) -> bytes: ...
35 def hexlify(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = 1) -> bytes: ...
36 def a2b_hex(hexstr: _AsciiBuffer, /) -> bytes: ...
37 def unhexlify(hexstr: _AsciiBuffer, /) -> bytes: ...
38
39 class Error(ValueError): ...
40 class Incomplete(Exception): ...