Your IP : 3.144.6.144


Current Path : /opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/__pycache__/base64.cpython-33.pyc

�
��f�6c@s�dZddlZddlZddlZddddddd	d
ddd
dddgZeefZdd�Zddd�Z
ddodd�Zdd
�Z
dd�Zejdd�Zejdd�Zdd�Zdd�Zi dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6ZdZd[�eej��D�Zed\d[�ej�D��Zd]d	�Zdodd^d
�Zd_d�Zdod`d�ZdaZed;d3Zdbd�Z dcd�Z!ddd�Z"dedf�Z#dgd�Z$dhdi�Z%djdk�Z&dldm�Z'e(dnkr�e&�ndS(pu/RFC 3548: Base16, Base32, Base64 Data EncodingsiNuencodeudecodeuencodebytesudecodebytesu	b64encodeu	b64decodeu	b32encodeu	b32decodeu	b16encodeu	b16decodeustandard_b64encodeustandard_b64decodeuurlsafe_b64encodeuurlsafe_b64decodecCsqt|t�rDy|jd�SWqmtk
r@td��YqmXn)t|t�rW|Std|jj��dS(Nuasciiu4string argument should contain only ASCII charactersu0argument should be bytes or ASCII string, not %s(	u
isinstanceustruencodeuUnicodeEncodeErroru
ValueErrorubytes_typesu	TypeErroru	__class__u__name__(us((u+/opt/alt/python33/lib64/python3.3/base64.pyu_bytes_from_decode_data s
u_bytes_from_decode_datacCs�t|t�s(td|jj��ntj|�dd�}|dk	r�t|t�sutd|jj��nt|�dks�t	t
|���|jtj
d|��S|S(uSEncode a byte string using Base64.

    s is the byte string to encode.  Optional altchars must be a byte
    string of length 2 which specifies an alternative alphabet for the
    '+' and '/' characters.  This allows an application to
    e.g. generate url or filesystem safe Base64 strings.

    The encoded byte string is returned.
    uexpected bytes, not %sNiis+/i����(u
isinstanceubytes_typesu	TypeErroru	__class__u__name__ubinasciiu
b2a_base64uNoneulenuAssertionErrorurepru	translateubytesu	maketrans(usualtcharsuencoded((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b64encode/s
$cCs�t|�}|dk	rft|�}t|�dksHtt|���|jtj|d��}n|r�tj	d|�r�t
jd��nt
j|�S(uDecode a Base64 encoded byte string.

    s is the byte string to decode.  Optional altchars must be a
    string of length 2 which specifies the alternative alphabet used
    instead of the '+' and '/' characters.

    The decoded string is returned.  A binascii.Error is raised if s is
    incorrectly padded.

    If validate is False (the default), non-base64-alphabet characters are
    discarded prior to the padding check.  If validate is True,
    non-base64-alphabet characters in the input result in a binascii.Error.
    is+/s^[A-Za-z0-9+/]*={0,2}$uNon-base64 digit foundN(
u_bytes_from_decode_datauNoneulenuAssertionErrorurepru	translateubytesu	maketransureumatchubinasciiuErroru
a2b_base64(usualtcharsuvalidate((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b64decodeFs$cCs
t|�S(u�Encode a byte string using the standard Base64 alphabet.

    s is the byte string to encode.  The encoded byte string is returned.
    (u	b64encode(us((u+/opt/alt/python33/lib64/python3.3/base64.pyustandard_b64encode^scCs
t|�S(uDecode a byte string encoded with the standard Base64 alphabet.

    s is the byte string to decode.  The decoded byte string is
    returned.  binascii.Error is raised if the input is incorrectly
    padded or if there are non-alphabet characters present in the
    input.
    (u	b64decode(us((u+/opt/alt/python33/lib64/python3.3/base64.pyustandard_b64decodeess+/s-_cCst|�jt�S(u�Encode a byte string using a url-safe Base64 alphabet.

    s is the byte string to encode.  The encoded byte string is
    returned.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    (u	b64encodeu	translateu_urlsafe_encode_translation(us((u+/opt/alt/python33/lib64/python3.3/base64.pyuurlsafe_b64encodesscCs%t|�}|jt�}t|�S(uXDecode a byte string encoded with the standard Base64 alphabet.

    s is the byte string to decode.  The decoded byte string is
    returned.  binascii.Error is raised if the input is incorrectly
    padded or if there are non-alphabet characters present in the
    input.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    (u_bytes_from_decode_datau	translateu_urlsafe_decode_translationu	b64decode(us((u+/opt/alt/python33/lib64/python3.3/base64.pyuurlsafe_b64decode|s
sAsJi	sSis3isBisKi
sTis4isCisLisUis5isDisMisVis6isEisNi
sWis7isFisOisXisGisPisYisHisQisZisIisRis2icCs g|]\}}|d�qS(i((u.0ukuv((u+/opt/alt/python33/lib64/python3.3/base64.pyu
<listcomp>�s	u
<listcomp>cCs&g|]\}}|d|f�qS(i((u.0ukuv((u+/opt/alt/python33/lib64/python3.3/base64.pyu
<listcomp>�s	c
Cs�t|t�s(td|jj��ntt|�d�\}}|rj|td|�}|d7}nt�}x�t	|�D]�}t
jd||d|dd��\}}}||d@d>7}||d@d>7}|tt|d?t|d	?d
@t|d?d
@t|d?t|d?d
@t|d
?d
@t|d?t|d
@g�7}q�W|dkrvd|dd�<n]|d
kr�d|dd�<n>|dkr�d|dd�<n|dkr�d|dd�<nt|�S(urEncode a byte string using Base32.

    s is the byte string to encode.  The encoded byte string is returned.
    uexpected bytes, not %siiu!HHBiiiiiiiiis======Ns====is===s=i����i����i����i����(
u
isinstanceubytes_typesu	TypeErroru	__class__u__name__udivmodulenubytesu	bytearrayurangeustructuunpacku_b32tab(usuquantauleftoveruencodeduiuc1uc2uc3((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b32encode�s8
	1c
Cs�t|�}tt|�d�\}}|r?tjd��n|d	k	r�t|�}t|�dks{tt|���|jt	j
dd|��}n|r�|j�}nd}tj
d|�}|rt|jd��}|dkr|d	|�}qng}d}d
}	x�|D]�}
tj|
�}|d	krTtjd��n|t|
|	>7}|	d8}	|	dkr!|jtjt	d
|d���d}d
}	q!q!Wtjt	d
|d��}|dkr�d}n�|dkr|d	d�}nl|dkr!|d	d�}nM|dkr@|d	d�}n.|dkr_|d	d�}ntjd��|j|�dj|�S(u]Decode a Base32 encoded byte string.

    s is the byte string to decode.  Optional casefold is a flag
    specifying whether a lowercase alphabet is acceptable as input.
    For security purposes, the default is False.

    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) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the 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 byte string is returned.  binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    iuIncorrect paddingis01sOis(?P<pad>[=]*)$upadNi#uNon-base32 digit foundiu%010xuasciisiiiii����i����i����i����(u_bytes_from_decode_dataudivmodulenubinasciiuErroruNoneuAssertionErrorurepru	translateubytesu	maketransuupperureusearchugroupu_b32revugetuappendu	unhexlifyujoin(
usucasefoldumap01uquantauleftoverupadcharsumoupartsuaccushiftucuvalulast((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b32decode�sV$"

#
	
cCs;t|t�s(td|jj��ntj|�j�S(urEncode a byte string using Base16.

    s is the byte string to encode.  The encoded byte string is returned.
    uexpected bytes, not %s(u
isinstanceubytes_typesu	TypeErroru	__class__u__name__ubinasciiuhexlifyuupper(us((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b16encodescCsRt|�}|r!|j�}ntjd|�rEtjd��ntj|�S(u�Decode a Base16 encoded byte string.

    s is the byte 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 byte string is returned.  binascii.Error is raised if
    s were incorrectly padded or if there are non-alphabet characters
    present in the string.
    s	[^0-9A-F]uNon-base16 digit found(u_bytes_from_decode_datauupperureusearchubinasciiuErroru	unhexlify(usucasefold((u+/opt/alt/python33/lib64/python3.3/base64.pyu	b16decodesiLcCs�x~|jt�}|sPnxCt|�tkra|jtt|��}|sTPn||7}qWtj|�}|j|�qdS(u1Encode a file; input and output are binary files.N(ureadu
MAXBINSIZEulenubinasciiu
b2a_base64uwrite(uinputuoutputusunsuline((u+/opt/alt/python33/lib64/python3.3/base64.pyuencode:scCs<x5|j�}|sPntj|�}|j|�qdS(u1Decode a file; input and output are binary files.N(ureadlineubinasciiu
a2b_base64uwrite(uinputuoutputulineus((u+/opt/alt/python33/lib64/python3.3/base64.pyudecodeIscCs�t|t�s(td|jj��ng}xJtdt|�t�D]0}|||t�}|jt	j
|��qGWdj|�S(uTEncode a bytestring into a bytestring containing multiple lines
    of base-64 data.uexpected bytes, not %sis(u
isinstanceubytes_typesu	TypeErroru	__class__u__name__urangeulenu
MAXBINSIZEuappendubinasciiu
b2a_base64ujoin(usupiecesuiuchunk((u+/opt/alt/python33/lib64/python3.3/base64.pyuencodebytesSscCs)ddl}|jdtd�t|�S(uLegacy alias of encodebytes().iNu7encodestring() is a deprecated alias, use encodebytes()i(uwarningsuwarnuDeprecationWarninguencodebytes(usuwarnings((u+/opt/alt/python33/lib64/python3.3/base64.pyuencodestring^s	
uencodestringcCs5t|t�s(td|jj��ntj|�S(u6Decode a bytestring of base-64 data into a bytestring.uexpected bytes, not %s(u
isinstanceubytes_typesu	TypeErroru	__class__u__name__ubinasciiu
a2b_base64(us((u+/opt/alt/python33/lib64/python3.3/base64.pyudecodebytesfscCs)ddl}|jdtd�t|�S(uLegacy alias of decodebytes().iNu7decodestring() is a deprecated alias, use decodebytes()i(uwarningsuwarnuDeprecationWarningudecodebytes(usuwarnings((u+/opt/alt/python33/lib64/python3.3/base64.pyudecodestringls	
udecodestringc	Cs|ddl}ddl}y)|j|jdd�d�\}}Wn`|jk
r�}z=|j|_t|�td|jd�|jd�WYdd}~XnXt}xj|D]b\}}|dkr�t}n|dkr�t	}n|d	kr�t	}n|d
kr�t
�dSq�W|r_|ddkr_t|dd��}|||jj�WdQXn||j
j|jj�dS(
uSmall main programiNiudeutu�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'iu-eu-du-uu-tu-urb(usysugetoptuargvuerrorustderrustdoutuprintuexituencodeudecodeutestuopenubufferustdin(	usysugetoptuoptsuargsumsgufuncuouauf((u+/opt/alt/python33/lib64/python3.3/base64.pyumainus0)
 			umaincCsdd}tt|��t|�}tt|��t|�}tt|��||ks`t�dS(NsAladdin:open sesame(uprinturepruencodebytesudecodebytesuAssertionError(us0us1us2((u+/opt/alt/python33/lib64/python3.3/base64.pyutest�sutestu__main__F()u__doc__ureustructubinasciiu__all__ubytesu	bytearrayubytes_typesu_bytes_from_decode_datauNoneu	b64encodeuFalseu	b64decodeustandard_b64encodeustandard_b64decodeu	maketransu_urlsafe_encode_translationu_urlsafe_decode_translationuurlsafe_b64encodeuurlsafe_b64decodeu_b32alphabetusorteduitemsu_b32tabudictu_b32revu	b32encodeu	b32decodeu	b16encodeu	b16decodeuMAXLINESIZEu
MAXBINSIZEuencodeudecodeuencodebytesuencodestringudecodebytesudecodestringumainutestu__name__(((u+/opt/alt/python33/lib64/python3.3/base64.pyu<module>s\	+M

	


?>