summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-02 20:39:35 (GMT)
committerGeorg Brandl <georg@python.org>2010-08-02 20:39:35 (GMT)
commit62e4231a27667f30b4d2748379f4c6491f3a32c2 (patch)
treee5b3e55219c98033d95d8ca30e16f1701a062985 /Doc
parenta1631b337ab6d3c3d65f8834725a22e7781fa211 (diff)
downloadcpython-62e4231a27667f30b4d2748379f4c6491f3a32c2.zip
cpython-62e4231a27667f30b4d2748379f4c6491f3a32c2.tar.gz
cpython-62e4231a27667f30b4d2748379f4c6491f3a32c2.tar.bz2
#7797: be explicit about bytes-oriented interface of base64 functions.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/base64.rst30
1 files changed, 15 insertions, 15 deletions
diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst
index 9ff065a..39a466e 100644
--- a/Doc/library/base64.rst
+++ b/Doc/library/base64.rst
@@ -24,7 +24,7 @@ The modern interface provides:
.. function:: b64encode(s, altchars=None)
- Encode a string use Base64.
+ Encode a byte string use Base64.
*s* is the string to encode. Optional *altchars* must be a string of at least
length 2 (additional characters are ignored) which specifies an alternative
@@ -32,54 +32,54 @@ The modern interface provides:
generate URL or filesystem safe Base64 strings. The default is ``None``, for
which the standard Base64 alphabet is used.
- The encoded string is returned.
+ The encoded byte string is returned.
.. function:: b64decode(s, altchars=None)
- Decode a Base64 encoded string.
+ Decode a Base64 encoded byte string.
*s* is the string to decode. Optional *altchars* must be a string of at least
length 2 (additional characters are ignored) which specifies the alternative
alphabet used instead of the ``+`` and ``/`` characters.
- The decoded string is returned. A :exc:`TypeError` is raised if *s* were
+ The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
incorrectly padded or if there are non-alphabet characters present in the
string.
.. function:: standard_b64encode(s)
- Encode string *s* using the standard Base64 alphabet.
+ Encode byte string *s* using the standard Base64 alphabet.
.. function:: standard_b64decode(s)
- Decode string *s* using the standard Base64 alphabet.
+ Decode byte string *s* using the standard Base64 alphabet.
.. function:: urlsafe_b64encode(s)
- Encode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
+ Encode byte string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet. The result
can still contain ``=``.
.. function:: urlsafe_b64decode(s)
- Decode string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
+ Decode byte string *s* using a URL-safe alphabet, which substitutes ``-`` instead of
``+`` and ``_`` instead of ``/`` in the standard Base64 alphabet.
.. function:: b32encode(s)
- Encode a string using Base32. *s* is the string to encode. The encoded string
+ Encode a byte string using Base32. *s* is the string to encode. The encoded string
is returned.
.. function:: b32decode(s, casefold=False, map01=None)
- Decode a Base32 encoded string.
+ Decode a Base32 encoded byte string.
*s* is the string to decode. Optional *casefold* is a flag specifying whether a
lowercase alphabet is acceptable as input. For security purposes, the default
@@ -92,27 +92,27 @@ The modern interface provides:
digit 0 is always mapped to the letter O). For security purposes the default is
``None``, so that 0 and 1 are not allowed in the input.
- The decoded string is returned. A :exc:`TypeError` is raised if *s* were
+ The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
incorrectly padded or if there are non-alphabet characters present in the
string.
.. function:: b16encode(s)
- Encode a string using Base16.
+ Encode a byte string using Base16.
- *s* is the string to encode. The encoded string is returned.
+ *s* is the string to encode. The encoded byte string is returned.
.. function:: b16decode(s, casefold=False)
- Decode a Base16 encoded string.
+ Decode a Base16 encoded byte string.
*s* is the string to decode. Optional *casefold* is a flag specifying whether a
lowercase alphabet is acceptable as input. For security purposes, the default
is ``False``.
- The decoded string is returned. A :exc:`TypeError` is raised if *s* were
+ The decoded byte string is returned. A :exc:`TypeError` is raised if *s* were
incorrectly padded or if there are non-alphabet characters present in the
string.