Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
62e4231a
Commit
62e4231a
authored
14 years ago
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#7797: be explicit about bytes-oriented interface of base64 functions.
parent
a1631b33
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Doc/library/base64.rst
Doc/library/base64.rst
+15
-15
No files found.
Doc/library/base64.rst
View file @
62e4231a
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment