From 62e4231a27667f30b4d2748379f4c6491f3a32c2 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 2 Aug 2010 20:39:35 +0000 Subject: [PATCH] #7797: be explicit about bytes-oriented interface of base64 functions. --- Doc/library/base64.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst index 9ff065ab1be..39a466e5d36 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.