/usr/lib/python2.6/site-packages/oslo_serialization
Edit: /usr/lib/python2.6/site-packages/oslo_serialization/base64.pyc (2679B)
Ñò
7
Wc @@ s_ d Z d d k l Z d d k Z d d k Z d d „ Z d d „ Z d „ Z d d „ Z d S( s@
Utilities to encode and decode Base64.
.. versionadded:: 1.10
i ( t absolute_importNs utf-8c C@ s3 t | t i ƒ o | i | ƒ } n t i | ƒ S( s` Encode a string using Base64.
If *s* is a text string, first encode it to *encoding* (UTF-8 by default).
:param s: bytes or text string to be encoded
:param encoding: encoding used to encode *s* if it's a text string
:returns: Base64 encoded byte string (bytes)
Use encode_as_text() to get the Base64 encoded string as text.
( t
isinstancet sixt text_typet encodet base64t b64encode( t st encoding( ( sE /tmp/pip-build-wCUybK/oslo.serialization/oslo_serialization/base64.pyt encode_as_bytes s c C@ s t | d | ƒ} | i d ƒ S( sd Encode a string using Base64.
If *s* is a text string, first encode it to *encoding* (UTF-8 by default).
:param s: bytes or text string to be encoded
:param encoding: encoding used to encode *s* if it's a text string
:returns: Base64 encoded text string (Unicode)
Use encode_as_bytes() to get the Base64 encoded string as bytes.
R t ascii( R t decode( R R t encoded( ( sE /tmp/pip-build-wCUybK/oslo.serialization/oslo_serialization/base64.pyt encode_as_text- s c C@ s0 t | t ƒ o | i d ƒ } n t i | ƒ S( sÓ Decode a Base64 encoded string.
:param encoded: bytes or text Base64 encoded string to be decoded
:returns: decoded bytes string (bytes)
Use decode_as_text() to get the decoded string as text.
R
( R t bytesR R t b64decode( R ( ( sE /tmp/pip-build-wCUybK/oslo.serialization/oslo_serialization/base64.pyt decode_as_bytes<