Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7cefc30d
Kaydet (Commit)
7cefc30d
authored
Eki 17, 2010
tarafından
R. David Murray
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tighten up 'byte string' wording in base64 docs.
üst
a90032a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
base64.rst
Doc/library/base64.rst
+22
-20
No files found.
Doc/library/base64.rst
Dosyayı görüntüle @
7cefc30d
...
@@ -10,21 +10,23 @@
...
@@ -10,21 +10,23 @@
single: MIME; base64 encoding
single: MIME; base64 encoding
This module provides data encoding and decoding as specified in :rfc:`3548`.
This module provides data encoding and decoding as specified in :rfc:`3548`.
This standard defines the Base16, Base32, and Base64 algorithms for encoding and
This standard defines the Base16, Base32, and Base64 algorithms for encoding
decoding arbitrary binary strings into text strings that can be safely sent by
and decoding arbitrary binary strings into ASCII-only byte strings that can be
email, used as parts of URLs, or included as part of an HTTP POST request. The
safely sent by email, used as parts of URLs, or included as part of an HTTP
encoding algorithm is not the same as the :program:`uuencode` program.
POST request. The encoding algorithm is not the same as the
:program:`uuencode` program.
There are two interfaces provided by this module. The modern interface supports
encoding and decoding string objects using all three alphabets. The legacy
There are two interfaces provided by this module. The modern interface
interface provides for encoding and decoding to and from file-like objects as
supports encoding and decoding ASCII byte string objects using all three
well as strings, but only using the Base64 standard alphabet.
alphabets. The legacy interface provides for encoding and decoding to and from
file-like objects as well as byte strings, but only using the Base64 standard
alphabet.
The modern interface provides:
The modern interface provides:
.. function:: b64encode(s, altchars=None)
.. function:: b64encode(s, altchars=None)
Encode a byte string us
e
Base64.
Encode a byte string us
ing
Base64.
*s* is the string to encode. Optional *altchars* must be a string of at least
*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
length 2 (additional characters are ignored) which specifies an alternative
...
@@ -39,9 +41,9 @@ The modern interface provides:
...
@@ -39,9 +41,9 @@ The modern interface provides:
Decode a Base64 encoded byte string.
Decode a Base64 encoded byte string.
*s* is the
string to decode. Optional *altchars* must be a string of at least
*s* is the
byte string to decode. Optional *altchars* must be a string of
length 2 (additional characters are ignored) which specifies the alternativ
e
at least length 2 (additional characters are ignored) which specifies th
e
alphabet used instead of the ``+`` and ``/`` characters.
al
ternative al
phabet used instead of the ``+`` and ``/`` characters.
The decoded byte 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
incorrectly padded or if there are non-alphabet characters present in the
...
@@ -81,9 +83,9 @@ The modern interface provides:
...
@@ -81,9 +83,9 @@ The modern interface provides:
Decode a Base32 encoded byte string.
Decode a Base32 encoded byte string.
*s* is the
string to decode. Optional *casefold* is a flag specifying whether a
*s* is the
byte string to decode. Optional *casefold* is a flag specifying
lowercase alphabet is acceptable as input. For security purposes, the default
whether a lowercase alphabet is acceptable as input. For security purposes,
is ``False``.
the default
is ``False``.
:rfc:`3548` allows for optional mapping of the digit 0 (zero) to the letter O
:rfc:`3548` allows for optional mapping of the digit 0 (zero) to the letter O
(oh), and for optional mapping of the digit 1 (one) to either the letter I (eye)
(oh), and for optional mapping of the digit 1 (one) to either the letter I (eye)
...
@@ -130,8 +132,8 @@ The legacy interface:
...
@@ -130,8 +132,8 @@ The legacy interface:
.. function:: decodebytes(s)
.. function:: decodebytes(s)
decodestring(s)
decodestring(s)
Decode the bytestring *s*, which must contain one or more lines of base64
Decode the byte
string *s*, which must contain one or more lines of base64
encoded data, and return a bytestring containing the resulting binary data.
encoded data, and return a byte
string containing the resulting binary data.
``decodestring`` is a deprecated alias.
``decodestring`` is a deprecated alias.
...
@@ -147,8 +149,8 @@ The legacy interface:
...
@@ -147,8 +149,8 @@ The legacy interface:
.. function:: encodebytes(s)
.. function:: encodebytes(s)
encodestring(s)
encodestring(s)
Encode the bytestring *s*, which can contain arbitrary binary data, and
Encode the byte
string *s*, which can contain arbitrary binary data, and
return a bytestring containing one or more lines of base64-encoded data.
return a byte
string containing one or more lines of base64-encoded data.
:func:`encodebytes` returns a string containing one or more lines of
:func:`encodebytes` returns a string containing one or more lines of
base64-encoded data always including an extra trailing newline (``b'\n'``).
base64-encoded data always including an extra trailing newline (``b'\n'``).
``encodestring`` is a deprecated alias.
``encodestring`` is a deprecated alias.
...
...
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