Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62e4231

Browse files
committed
#7797: be explicit about bytes-oriented interface of base64 functions.
1 parent a1631b3 commit 62e4231

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

Doc/library/base64.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,62 +24,62 @@ The modern interface provides:
2424

2525
.. function:: b64encode(s, altchars=None)
2626

27-
Encode a string use Base64.
27+
Encode a byte string use Base64.
2828

2929
*s* is the string to encode. Optional *altchars* must be a string of at least
3030
length 2 (additional characters are ignored) which specifies an alternative
3131
alphabet for the ``+`` and ``/`` characters. This allows an application to e.g.
3232
generate URL or filesystem safe Base64 strings. The default is ``None``, for
3333
which the standard Base64 alphabet is used.
3434

35-
The encoded string is returned.
35+
The encoded byte string is returned.
3636

3737

3838
.. function:: b64decode(s, altchars=None)
3939

40-
Decode a Base64 encoded string.
40+
Decode a Base64 encoded byte string.
4141

4242
*s* is the string to decode. Optional *altchars* must be a string of at least
4343
length 2 (additional characters are ignored) which specifies the alternative
4444
alphabet used instead of the ``+`` and ``/`` characters.
4545

46-
The decoded string is returned. A :exc:`TypeError` is raised if *s* were
46+
The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
4747
incorrectly padded or if there are non-alphabet characters present in the
4848
string.
4949

5050

5151
.. function:: standard_b64encode(s)
5252

53-
Encode string *s* using the standard Base64 alphabet.
53+
Encode byte string *s* using the standard Base64 alphabet.
5454

5555

5656
.. function:: standard_b64decode(s)
5757

58-
Decode string *s* using the standard Base64 alphabet.
58+
Decode byte string *s* using the standard Base64 alphabet.
5959

6060

6161
.. function:: urlsafe_b64encode(s)
6262

63-
Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
63+
Encode byte string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
6464
``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result
6565
can still contain ``=``.
6666

6767

6868
.. function:: urlsafe_b64decode(s)
6969

70-
Decode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
70+
Decode byte string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
7171
``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet.
7272

7373

7474
.. function:: b32encode(s)
7575

76-
Encode a string using Base32. *s* is the string to encode. The encoded string
76+
Encode a byte string using Base32. *s* is the string to encode. The encoded string
7777
is returned.
7878

7979

8080
.. function:: b32decode(s, casefold=False, map01=None)
8181

82-
Decode a Base32 encoded string.
82+
Decode a Base32 encoded byte string.
8383

8484
*s* is the string to decode. Optional *casefold* is a flag specifying whether a
8585
lowercase alphabet is acceptable as input. For security purposes, the default
@@ -92,27 +92,27 @@ The modern interface provides:
9292
digit 0 is always mapped to the letter O). For security purposes the default is
9393
``None``, so that 0 and 1 are not allowed in the input.
9494

95-
The decoded string is returned. A :exc:`TypeError` is raised if *s* were
95+
The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
9696
incorrectly padded or if there are non-alphabet characters present in the
9797
string.
9898

9999

100100
.. function:: b16encode(s)
101101

102-
Encode a string using Base16.
102+
Encode a byte string using Base16.
103103

104-
*s* is the string to encode. The encoded string is returned.
104+
*s* is the string to encode. The encoded byte string is returned.
105105

106106

107107
.. function:: b16decode(s, casefold=False)
108108

109-
Decode a Base16 encoded string.
109+
Decode a Base16 encoded byte string.
110110

111111
*s* is the string to decode. Optional *casefold* is a flag specifying whether a
112112
lowercase alphabet is acceptable as input. For security purposes, the default
113113
is ``False``.
114114

115-
The decoded string is returned. A :exc:`TypeError` is raised if *s* were
115+
The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
116116
incorrectly padded or if there are non-alphabet characters present in the
117117
string.
118118

0 commit comments

Comments
 (0)