@@ -63,7 +63,7 @@ class Error(Exception):
63
63
64
64
if not "unhexlify" in globals ():
65
65
# pylint: disable=function-redefined
66
- def unhexlify (hexstr ) :
66
+ def unhexlify (hexstr : str ) -> bytes :
67
67
"""Return the binary data represented by hexstr.
68
68
:param str hexstr: Hexadecimal string.
69
69
@@ -76,7 +76,7 @@ def unhexlify(hexstr):
76
76
77
77
if not "hexlify" in globals ():
78
78
# pylint: disable=function-redefined
79
- def hexlify (data ) :
79
+ def hexlify (data : bytes ) -> bytes :
80
80
"""Return the hexadecimal representation of the
81
81
binary data. Every byte of data is converted into
82
82
the corresponding 2-digit hex representation.
@@ -96,7 +96,7 @@ def hexlify(data):
96
96
A2B_HEX = unhexlify
97
97
98
98
99
- def _transform (n ) :
99
+ def _transform (n : int ) -> str :
100
100
if n == - 1 :
101
101
return "\xff "
102
102
return chr (n )
@@ -106,7 +106,7 @@ def _transform(n):
106
106
assert len (TABLE_A2B_B64 ) == 256
107
107
108
108
109
- def a2b_base64 (b64_data ) :
109
+ def a2b_base64 (b64_data : str ) -> bytes :
110
110
"""Convert a block of base64 data back to binary and return the binary data.
111
111
112
112
:param str b64_data: Base64 data.
@@ -148,7 +148,7 @@ def a2b_base64(b64_data):
148
148
return b"" .join (res )
149
149
150
150
151
- def b2a_base64 (bin_data ) :
151
+ def b2a_base64 (bin_data : str ) -> bytes :
152
152
"""Convert binary data to a line of ASCII characters in base64 coding.
153
153
154
154
:param str bin_data: Binary data string, as bytes
0 commit comments