Your IP : 3.15.10.139


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/base64.cpython-310.opt-2.pyc

o

6��f|Q�@s�	ddlZddlZddlZgd�ZeefZdd�ZdPdd�ZdQdd	�Z	d
d�Z
dd
�Ze�dd�Z
e�dd�Zdd�Zdd�ZdZdZdZdZdZiaiadd�ZdRdd�Zdd�Zejdd �e_dRd!d"�Zejded#�e_d$d%�Zejd&d �e_dSd'd(�Zejd&d)d#�e_d*d+�Z dSd,d-�Z!da"da#d.Z$d/Z%dTd0d1�Z&ddddd2�d3d4�Z'ddd5d6�d7d8�Z(d9Z)da*da+da,dSd:d;�Z-d<d=�Z.d>Z/e/d?d@Z0dAdB�Z1dCdD�Z2dEdF�Z3dGdH�Z4dIdJ�Z5dKdL�Z6dMdN�Z7e8dOkr�e6�dSdS)U�N)�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�b32hexencode�b32hexdecode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCslt|t�rz|�d�WStytd��wt|t�r|Szt|���WSty5td|j	j
�d�w)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r#�-/opt/alt/python310/lib64/python3.10/base64.py�_bytes_from_decode_data"s"
�
���r%cCs.	tj|dd�}|dur|�t�d|��S|S)NF)�newline�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r"�altchars�encodedr#r#r$r3s
rFcCsP	t|�}|durt|�}|�t�|d��}|r#t�d|�s#t�d��t�|�S)Nr's[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)	r%r*r+r,�re�	fullmatchr(�Error�
a2b_base64)r"r-Zvalidater#r#r$rAs

rcC�
	t|�S�N)rr!r#r#r$rZsrcCr3r4)rr!r#r#r$rasrr's-_cCs	t|��t�Sr4)rr*�_urlsafe_encode_translationr!r#r#r$rosrcCs	t|�}|�t�}t|�Sr4)r%r*�_urlsafe_decode_translationrr!r#r#r$rxs

rzK
Encode the bytes-like objects using {encoding} and return a bytes object.
a�
Decode the {encoding} encoded bytes-like object or ASCII string s.

Optional casefold is a flag specifying whether a lowercase alphabet is
acceptable as input.  For security purposes, the default is False.
{extra_args}
The result is returned as a bytes object.  A binascii.Error is raised if
the input is incorrectly padded or if there are non-alphabet
characters present in the input.
a�
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.
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567s 0123456789ABCDEFGHIJKLMNOPQRSTUVcsR|tvrdd�|D���fdd��D�t|<d�t|t�s#t|���}t|�d}|r3|dd|}t�}tj}t|}t	dt|�d�D]+}||||d�d�}|||d?||d	?d
@||d?d
@||d
@7}qE|dkrd
|dd�<t
|�S|dkr�d|dd�<t
|�S|dkr�d|dd�<t
|�S|dkr�d|dd�<t
|�S)NcS�g|]}t|f��qSr#�r+��.0�ir#r#r$�
<listcomp>��z_b32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr#r#�r:�a�b�Zb32tabr#r$r<����r�big��i��
�s======i�����s====����s===�����=���)�_b32tab2rrrr�len�	bytearray�int�
from_bytes�ranger+)�alphabetr"�leftoverr.rUZb32tab2r;�cr#rAr$�
_b32encode�sB
��
����rZc	Cst|tvrdd�t|�D�t|<t|�}t|�drt�d��|dur1t|�}|�t�dd|��}|r7|�	�}t|�}|�
d�}|t|�}t�}t|}tdt|�d�D]1}|||d�}	d}
z|	D]
}|
d	>||}
qdWn
t
y}t�d
�d�w||
�d	d�7}qU|ds�|dvr�t�d��|r�|r�|
d	|K}
|
�d	d�}d
d	|d}
|d|
�|dd�<t|�S)NcSsi|]\}}||�qSr#r#)r:�k�vr#r#r$�
<dictcomp>�r=z_b32decode.<locals>.<dictcomp>�zIncorrect paddings01�OrOrrCzNon-base32 digit foundrE>rrIrLrN��+���)�_b32rev�	enumerater%rRr(r1r*r+r,�upper�rstriprSrV�KeyError�to_bytes)rWr"�casefold�map01�lZpadchars�decodedZb32revr;Zquanta�accrYZlastrXr#r#r$�
_b32decode�sD

��
rncC�
tt|�Sr4)rZ�_b32alphabetr!r#r#r$r��
rZbase32)�encodingcCstt|||�Sr4)rnrp)r"rirjr#r#r$r	�sr	)rrZ
extra_argscCror4)rZ�_b32hexalphabetr!r#r#r$r
rqr
Z	base32hexcCstt||�Sr4)rnrs�r"rir#r#r$rsr�cCs	t�|���Sr4)r(Zhexlifyrer!r#r#r$rsrcCs6	t|�}|r|��}t�d|�rt�d��t�|�S)Ns	[^0-9A-F]zNon-base16 digit found)r%rer/�searchr(r1Z	unhexlifyrtr#r#r$r
s	

r
s<~s~>c	s�t|t�st|���}t|�d}|r|d|}t�dt|�d��|�}����fdd�|D�}|rQ|sQ|ddkrF�dd	|d<|dd|�|d<d
�|�S)NrNrDz!%dIcsPg|]$}�r
|s
dn�r|dkrdn�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r#)r:Zword��chars�chars2�foldnuls�
foldspacesr#r$r<9s�
�
��z_85encode.<locals>.<listcomp>rPrwrrC�)	rrrrrR�struct�StructZunpack�join)	r@r{r|�padr}r~�paddingZwords�chunksr#rzr$�	_85encode/s
�
r�)r~�wrapcolr��adobecs�	tdurdd�tdd�D�add�tD�at|tt|d|��|r%t���rVt|r,dnd�����fd	d�td
t����D�}|rQt|d�d�krQ|�d�d
�|��|r\�t	7��S)NcSr7r#r8r9r#r#r$r<\r=za85encode.<locals>.<listcomp>�!�vcS�g|]}tD]}||�qqSr#)�	_a85charsr>r#r#r$r<]rBTrJrIcsg|]
}�||���qSr#r#r9��resultr�r#r$r<es�rrPr�
)
�
_a85chars2rVr�r��	_A85START�maxrR�appendr��_A85END)r@r~r�r�r�r�r#r�r$rGs&�

rs 	

)r~r��ignorecharsc	Cs|	t|�}|r%|�t�std�t���|�t�r|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]k}
d|
krHdkr}nn3||
�t|�dkr|d	}|D]
}
d
||
d}qXz|||��Wn
tj
yxtd�d�w|	�q<|
dkr�|r�td
��|d�q<|r�|
dkr�|r�td��|d�q<|
|vr�q<td|
��d�|�}dt|�}
|
r�|d|
�}|S)Nz1Ascii85 encoded byte sequences must end with {!r}rJ����!Isuuuur��urCrryzAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crrN)r%�endswithr�r�format�
startswithr�r�r��packr��clearrR�errorr�)r@r~r�r��packIrlZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrmr�r�r#r#r$rps^
�

��


rsU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs4	tdurdd�tD�add�tD�at|tt|�S)NcSr7r#r8r9r#r#r$r<�r=zb85encode.<locals>.<listcomp>cSr�r#)�	_b85charsr>r#r#r$r<�rB)�
_b85chars2�_b85alphabetr�r�)r@r�r#r#r$r�s
rc
	Cs:	tdurdgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]T}|||d�}d}z|D]
}|dt|}qGWn t	yst|�D]\}}t|durqt
d||�d�q^�wz	|�||��Wq8tjy�t
d|�d�wd	�
|�}	|r�|	d|�}	|	S)
N�rC�~r�rryz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dr)�_b85decrdr�r%rRr�r�r�rVrrr�r�r�)
r@r;rYr��outr��chunkrm�jr�r#r#r$r�sR

��������
r�LrNrLcCsd		|�t�}|sdSt|�tkr'|�tt|��}|sn
||7}t|�tkst�|�}|�|�qr4)�read�
MAXBINSIZErRr(r)�write)�input�outputr"�ns�liner#r#r$r�s
�

�rcCs*		|��}|s
dSt�|�}|�|�qr4)�readliner(r2r�)r�r�r�r"r#r#r$rs

�rc
Cs�zt|�}Wnty}zd|jj}t|�|�d}~ww|jdvr0d|j|jjf}t|��|jdkrBd|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rYr@�Bz-expected single byte elements, not %r from %srIz(expected 1-D data, not %d-D data from %s)rrrr r��ndim)r"�m�err�msgr#r#r$�_input_type_checks$
��
�
��r�cCsN	t|�g}tdt|�t�D]}|||t�}|�t�|��qd�|�S)Nrr)r�rVrRr�r�r(r)r�)r"�piecesr;r�r#r#r$r$s
rcCs	t|�t�|�Sr4)r�r(r2r!r#r#r$r/s
rc	
Cs6	ddl}ddl}z|�|jdd�d�\}}Wn)|jyA}z|j|_t|�td|jd�|�d�WYd}~nd}~wwt}|D] \}}|dkrPt}|dkrVt	}|dkr\t	}|d	krft
�dSqF|r�|dd
kr�t|dd��}|||jj�Wd�dS1s�wYdS||j
j|jj�dS)NrrIZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rJz-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or?�fr#r#r$�main6s0���"�r�cCs<d}tt|��t|�}tt|��t|�}tt|��dS)NsAladdin:open sesame)r��reprrr)Zs0�s1�s2r#r#r$r�Psr��__main__r4)NF)FN)F)FFF)9r/r�r(�__all__r+rSrr%rrrrr,r5r6rrZ_B32_ENCODE_DOCSTRINGZ_B32_DECODE_DOCSTRINGZ_B32_DECODE_MAP01_DOCSTRINGrprsrQrcrZrnrr��__doc__r	r
rrr
r�r�r�r�r�rrr�r�r�r�rrZMAXLINESIZEr�rrr�rrr�r�r r#r#r#r$�<module>s~

	
	
$/
�
�

)H
-	

�

?>