Your IP : 18.117.91.116


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/base64.cpython-312.opt-2.pyc

�

�Q�f�P��^�	ddlZddlZddlZgd�ZeefZd�Zd4d�Zd5d�Z	d�Z
d�Zejd	d
�Z
ejd
d	�Zd�Zd�Zd
ZdZdZdZdZiaiad�Zd6d�Zd�Zej7d��e_d6d�Zej7de��e_d�Zej7d��e_d7d�Zej7dd��e_d�Z d7d�Z!da"da#dZ$d Z%d8d!�Z&ddddd"�d#�Z'ddd$d%�d&�Z(d'Z)da*da+da,d7d(�Z-d)�Z.d*Z/e/d+zd,zZ0d-�Z1d.�Z2d/�Z3d0�Z4d1�Z5d2�Z6e7d3k(re6�yy)9�N)�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�b32hexencode�b32hexdecode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodec�.�t|t�r	|jd�St|t
�r|S	t
|�j�S#t$rt	d��wxYw#t$r$td|jjz�d�wxYw)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__��ss �-/opt/alt/python312/lib64/python3.12/base64.py�_bytes_from_decode_datar&"s����!�S��	U��8�8�G�$�$��!�[�!���K��!�}�$�$�&�&��"�	U��S�T�T�	U���K��)�+,�;�;�+?�+?�@�A�FJ�	K�K�s�A�A'�A$�'-Bc��	tj|d��}|�%|jtj	d|��S|S)NF)�newline�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r$�altchars�encodeds   r%rr3sB����!�!�!�U�3�G���� � ������!A�B�B��N�Fc��	t|�}|�0t|�}|jtj|d��}t	j
||��S)Nr))�strict_mode)r&r,r-r.r*�
a2b_base64)r$r/�validates   r%rrAsO���"	 ��"�A���*�8�4��
�K�K�����%�8�9�����q�h�7�7r1c��	t|�S�N)rr#s r%rr[s����Q�<�r1c��	t|�Sr7)rr#s r%rrbs����Q�<�r1r)s-_c�@�	t|�jt�Sr7)rr,�_urlsafe_encode_translationr#s r%rrps����Q�<�!�!�"=�>�>r1c�Z�	t|�}|jt�}t|�Sr7)r&r,�_urlsafe_decode_translationrr#s r%rrys,��	�	 ��"�A�	���/�0�A��Q�<�r1zK
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 0123456789ABCDEFGHIJKLMNOPQRSTUVc���|tvr>|D�cgc]}t|f���}}|D��cgc]}|D]}||z��	�c}}t|<d}t|t�st	|�j�}t
|�dz}|r|dd|z
zz}t�}tj}t|}	tdt
|�d�D]<}||||dz�}
||	|
dz	|	|
dz	dzz|	|
dz	dzz|	|
dzzz
}�>|dk(rd	|d
dt|�S|dk(rd|d
dt|�S|dk(rd|ddt|�S|dk(rd|ddt|�Scc}wcc}}w)N��r��i��
�s======i�����s====����s===�����=���)�_b32tab2r-rrrr�len�	bytearray�int�
from_bytes�range)�alphabetr$�i�b32tab�a�b�leftoverr0rO�b32tab2�cs           r%�
_b32encoderY�s����x��'/�0�x�!�%���+�x��0�-3�D�V��V��a�!�e�V�e�V�D�������a��%��q�M�!�!�#���1�v��z�H��
���X��&�&���k�G����J��x� �G�
�1�c�!�f�a�
 ���q��A��E�{�#���G�A��G�$��Q�"�W��-�.�/��Q�"�W��-�.�/��A��I�&�'�	��!��1�}� �������>��

�Q�������
��>��	
�Q���������>��
�Q���������>���;1��Ds
�E�Ec�`�|tvr&t|�D��cic]\}}||��
c}}t|<t|�}t|�dzrt	j
d��|�3t|�}|j
tjdd|z��}|r|j�}t|�}|jd�}|t|�z
}t�}t|}	tdt|�d�D]4}
||
|
dz}d}	|D]
}
|dz|	|
z}�	||jd�z
}�6|dzs|d	vrt	j
d��|r.|r,d|zz}|jd�}d
d|zz
dz}|d||ddt|�Scc}}w#t$rt	j
d�d�wxYw)N�zIncorrect paddings01�OrIrr>zNon-base32 digit found>rrCrFrH��+���)�_b32rev�	enumerater&rLr*�Errorr,r-r.�upper�rstriprMrP�KeyError�to_bytes)rQr$�casefold�map01�k�v�l�padchars�decoded�b32revrR�quanta�accrX�lastrVs                r%�
_b32decoderr�s����w��.7��.A�B�.A�d�a��Q��T�.A�B������"�A�
�1�v��z��n�n�0�1�1�
��'��.��
�K�K�����t�e�|�<�=���
�G�G�I��	�A��A�	�����A��3�q�6�z�H��k�G�
�X�
�F�
�1�c�!�f�a�
 ���1�a�!�e�����	E����a�x�6�!�9�,���	�3�<�<��?�"��!�	�1�u���/��n�n�0�1�1��G���H�����|�|�A�����X��%�!�+���I�X��������>���OC��8�	E��.�.�!9�:��D�	E�s�
F�F
�
 F-c�"�tt|�Sr7)rY�_b32alphabetr#s r%r	r	�s���l�A�&�&r1�base32)�encodingc�&�tt|||�Sr7)rrrt)r$rgrhs   r%r
r
�s���l�A�x��7�7r1)rv�
extra_argsc�"�tt|�Sr7)rY�_b32hexalphabetr#s r%rrs���o�q�)�)r1�	base32hexc�$�tt||�Sr7)rrrz�r$rgs  r%rrs���o�q�(�3�3r1�c�J�	tj|�j�Sr7)r*�hexlifyrcr#s r%r
r
s!������A��$�$�&�&r1c��	t|�}|r|j�}tjd|�rt	j
d��t	j|�S)Ns	[^0-9A-F]zNon-base16 digit found)r&rc�re�searchr*rb�	unhexlifyr}s  r%rrsP���	 ��"�A��
�G�G�I��	�y�y��q�!��n�n�5�6�6����a� � r1s<~s~>c���t|t�st|�j�}t	|�dz}|r|d|zz}tjdt	|�dzz�j|�}|D�cgc].}|r|sdn%|r|dk(rdn||dz||dzd	zz||dzz��0}	}|r!|s|	d
dk(r|ddz|	d
<|	d
d||	d
<d
j|	�Scc}w)NrHr?z!%dI�zi    �yi�^	�Ui9rJrr>r1)	rrrrrL�struct�Struct�unpack�join)
rU�chars�chars2�pad�foldnuls�
foldspaces�padding�words�word�chunkss
          r%�	_85encoder�0s ���a��%��q�M�!�!�#���A��w�!�m�G��
�������M�M�&�C��F�a�K�0�1�8�8��;�E� �!�
 �$��t�d� �T�Z�%7�d��d�f�n�%��d�b�j�4�'�(�)��T�B�Y�� �!�
 ��!��s��"�:����q��A��F�2�J��B�Z�	�'��*��r�
��8�8�F����!s�:3C#)r��wrapcolr��adobec��	t�Htdd�D�cgc]}t|f���c}atD��cgc]}tD]}||z��	�c}}at	tt|d|�}|r	t
|z}|rqt
|rdnd|�}tdt|�|�D�cgc]
}||||z��}}|r%t|d�dz|kDr|jd�d	j|�}|r	|tz
}|Scc}wcc}}wcc}w)
N�!�vTrDrCrrJr1�
)�
_a85chars2rPr-�	_a85charsr��	_A85START�maxrL�appendr��_A85END)	rUr�r�r�r�rRrT�resultr�s	         r%rrHs���&��*/��C�.�9�.�Q�U�A�4�[�.�9�	�'0�D�y�!�)�Q�q�1�u�)�u�y�D�
�
�q�)�Z��d�J�
G�F���V�#����5�a�a��1�� ��C��K��9�;�9�a���A��K�(�9�	�;���6�"�:���"�W�,��
�
�c�"����F�#����'����M��%:��D��;s�C3�C8�C>s 	

)r�r��ignorecharsc�2�	t|�}|rS|jt�stdj	t���|jt�r|dd}n|dd}tjd�j}g}|j}g}|j}|j}	|dzD]�}
d|
cxkrdkrEnnB||
�t|�dk(s�(d	}|D]
}
d
|z|
dz
z}�	|||��|	��S|
dk(r|rtd
��|d��n|r|
dk(r|rtd��|d���|
|vr��td|
z��dj|�}dt|�z
}
|
r|d|
}|S#tj$r
td�d�wxYw)Nz1Ascii85 encoded byte sequences must end with {!r}rD����!Isuuuur��ur>rr�zAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %cr1rH)r&�endswithr�r�format�
startswithr�r�r��packr��clearrL�errorr�)rUr�r�r��packIrm�decoded_append�curr�curr_append�
curr_clear�xrpr�r�s              r%rrqs����	 ��"�A���z�z�'�"���"�F�7�O��
�
�<�<�	�"��!�B��A��#�2��A�

�M�M�$��$�$�E��G��^�^�N�
�D��+�+�K����J�
��\���a�"�7�"���N��4�y�A�~����A��s�(�a�"�f�-�C��C�"�5��:�.���
�'�\�� �!;�<�<��;�'�
�A��L�� �!;�<�<��.�/�
�+�
���:�Q�>�?�?�1�4�X�X�g�
�F��#�d�)�m�G���	�'��"���M��-�|�|�C�$�%7�8�d�B�C�s�+E6�6 FsU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~c���	t�BtD�cgc]}t|f���c}atD��cgc]}tD]}||z��	�c}}at	tt|�Scc}wcc}}wr7)�
_b85chars2�_b85alphabetr-�	_b85charsr�)rUr�rRrTs    r%rr�sb�����*6�7�,�Q�U�A�4�[�,�7�	�'0�D�y�!�)�Q�q�1�u�)�u�y�D�
��Q�	�:�s�3�3��8��Ds
�A �A%c��	t�&dgdzatt�D]\}}|t|<�t|�}t	|�dz}|d|zz}g}tjd�j}tdt	|�d�D]<}|||dz}d}	|D]}|dzt|z}�		|j||���>d	j|�}	|r|	d|}	|	S#t$r0t|�D] \}}t|��td||zz�d��wxYw#t
j$rtd|z�d�wxYw)
N�r>�~r�rr�z#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dr1)�_b85decrar�r&rLr�r�r�rPr rr�r�r�)
rUrRrXr��outr��chunkrp�jr�s
          r%rr�s~������&�3�,���l�+�D�A�q��G�A�J�,�	 ��"�A��A��w�!�m�G�	�D�7�N��A�
�C��M�M�$��$�$�E�
�1�c�!�f�a�
 ���!�A��E�
����	����B�h����+���	,��J�J�u�S�z�"�!�$�X�X�c�]�F���	�'��"���M���	�!�%�(���1��1�:�%�$�%J�'(�1�u�&.�/�48�9�)�
�	���|�|�	,��J� �!�"�'+�
,�	,�s�C!�-D�!#D�D�#E�LrHrFc��	|jt�x}r�t|�tkr^|jtt|�z
�x}r;||z
}t|�tkr$|jtt|�z
�x}r�;tj|�}|j|�|jt�x}r��yyr7)�read�
MAXBINSIZErLr*r+�write)�input�outputr$�ns�lines     r%rr�s���;��z�z�*�%�
%�!�
%��!�f�z�!�U�Z�Z�
�3�q�6�8I�-J�'J�r�'J�
��G�A��!�f�z�!�U�Z�Z�
�3�q�6�8I�-J�'J�r�'J��"�"�1�%�����T��	�z�z�*�%�
%�!�
%r1c��	|j�x}r:tj|�}|j|�|j�x}r�9yyr7)�readliner*r4r�)r�r�r�r$s    r%rrsF��;��.�.�"�
"�$�
"�����%�����Q���.�.�"�
"�$�
"r1c��	t|�}|jdvr1d|j�d|jj��}t|��|j
dk7r0d|j
|jjfz}t|��y#t$r*}d|jjz}t|�|�d}~wwxYw)Nz"expected bytes-like object, not %s)rXrU�Bz#expected single byte elements, not z from rCz(expected 1-D data, not %d-D data from %s)rr r!r"r��ndim)r$�m�err�msgs    r%�_input_type_checkr�s���&��q�M��	�x�x��&�+,�8�8�Q�[�[�5I�5I�K����n���v�v��{�9�+,�6�6�1�;�;�3G�3G�*H�I����n�����&�2�Q�[�[�5I�5I�I����n�#�%��&�s�B�	B?�%B:�:B?c���	t|�g}tdt|�t�D]2}|||tz}|j	tj|���4dj|�S)Nrr1)r�rPrLr�r�r*r+r�)r$�piecesrRr�s    r%rrsc����a��
�F�
�1�c�!�f�j�
)���!�a�*�n�%���
�
�h�)�)�%�0�1�*��8�8�F��r1c�D�	t|�tj|�Sr7)r�r*r4r#s r%rr's��B��a�����q�!�!r1c��	ddl}ddl}d|jd�d�}	|j|jddd�\}}t}D]8\}}|dk(rt}|dk(rt}|d	k(rt}|d
k(s�-t
|�yr>|ddk7r6t|dd�5}	||	|j
j�ddd�y||jj|j
j�y#|j$rC}|j|_t
|�t
|�|jd�Yd}~��d}~wwxYw#1swYyxYw)
Nrzusage: zx [-h|-d|-e|-u] [file|-]
        -h: print this help message and exit
        -d, -u: decode
        -e: encode (default)rC�hdeurDz-ez-dz-uz-h�-�rb)
�sys�getopt�argvr��stderr�stdout�print�exitrr�open�buffer�stdin)
r�r��usage�opts�argsr��func�orT�fs
          r%�mainr�.s+����������}�%�
 �E���]�]�3�8�8�A�B�<��8�
��d��D����1���9�V�d���9�V�d���9�V�d���9�e�E�l�F�	�
��Q��3��
�$�q�'�4�
 �A���C�J�J�%�%�&�!�
 �	
�S�Y�Y�
�
�s�z�z�0�0�1���<�<���Z�Z��
�
�c�
�
�e���������	��!�
 �s#�"C5�E
�5E�8E�E�
E�__main__r7)NF)FN)F)FFF)8r�r�r*�__all__r-rMrr&rrrrr.r:r<rr�_B32_ENCODE_DOCSTRING�_B32_DECODE_DOCSTRING�_B32_DECODE_MAP01_DOCSTRINGrtrzrKr`rYrrr	r��__doc__r
rrr
rr�r�r�r�r�rrr�r�r�r�rr�MAXLINESIZEr�rrr�rrr�r"�r1r%�<module>r�s���K�
�
����$�i� ��K�"�8�4��$�o�o�e�U�;��#�o�o�e�U�;��?�
�$��	����3��5��
��
��"�H,�^'�)�0�0�(�0�C�	��8�)�0�0�(�3N�1�P�	��*�,�3�3�[�3�I���4�-�3�3�[�?A�4�C���'�!�*
�	�
�
��	�
���0 %�a�U�%�'�R %�E�|�D�PE���	�
�
�
��4�'�Z���1�n�a�
�
���
� �"�2�6�z���F�r1

?>