Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/base64.cpython-311.pyc

�

c��f1R���dZddlZddlZddlZgd�ZeefZd�Zd6d�Z	d7d�Z
d�Zd	�Ze�
d
d��Ze�
dd
��Zd�Zd
�ZdZdZdZdZdZiaiad�Zd8d�Zd�Ze�d���e_d8d�Ze�de���e_d�Ze�d���e_d9d�Ze�dd���e_d�Z d9d�Z!da"da#d Z$d!Z%d:d"�Z&ddddd#�d$�Z'ddd%d&�d'�Z(d(Z)da*da+da,d9d)�Z-d*�Z.d+Z/e/d,zd-zZ0d.�Z1d/�Z2d0�Z3d1�Z4d2�Z5d3�Z6d4�Z7e8d5kre6��dSdS);zDBase16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings�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�Z�t|t��r3	|�d��S#t$rt	d���wxYwt|t
��r|S	t
|�����S#t$rtd|j	j
z��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/python311/lib64/python3.11/base64.py�_bytes_from_decode_datar&"s����!�S���U�	U��8�8�G�$�$�$��!�	U�	U�	U��S�T�T�T�	U�����!�[�!�!����K��!�}�}�$�$�&�&�&���K�K�K��)�+,�;�+?�@�A�A�FJ�	K�K���s�,�A�! B�(B*c���tj|d���}|�Xt|��dksJt|�����|�t
�d|����S|S)a*Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should 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.
    F)�newlineN��+/)�binascii�
b2a_base64�len�repr�	translate�bytes�	maketrans)r$�altchars�encodeds   r%rr3sk���!�!�U�3�3�3�G����8�}�}��!�!�!�4��>�>�!�!�!�� � ������!A�!A�B�B�B��N�Fc��t|��}|�gt|��}t|��dksJt|�����|�t�|d����}t
j||���S)a�Decode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    For more information about the strict base64 check, see:

    https://docs.python.org/3.11/library/binascii.html#binascii.a2b_base64
    Nr)r*)�strict_mode)r&r-r.r/r0r1r+�
a2b_base64)r$r2�validates   r%rrAs~��$	 ��"�"�A���*�8�4�4���8�}�}��!�!�!�4��>�>�!�!�!�
�K�K�����%�8�8�9�9����q�h�7�7�7�7r4c� �t|��S)zrEncode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    )rr#s r%rr[s��
�Q�<�<�r4c� �t|��S)aQDecode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    )rr#s r%rrbs���Q�<�<�r4r*s-_c�P�t|���t��S)z�Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    )rr/�_urlsafe_encode_translationr#s r%rrps���Q�<�<�!�!�"=�>�>�>r4c�r�t|��}|�t��}t|��S)a�Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    )r&r/�_urlsafe_decode_translationrr#s r%rrys/��	 ��"�"�A�	���/�0�0�A��Q�<�<�r4zK
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�|D����fd��D��t|<d�t|t��s!t|�����}t|��dz}|r|dd|z
zz}t
��}tj}t|}tdt|��d��D]P}||||dz���}|||dz	||dz	dzz||d	z	dzz||dzzz
}�Q|d
krd|dd�<n)|d
krd|dd�<n|dkrd|dd�<n
|dkrd|dd�<t|��S)Nc�.�g|]}t|f����S��r0��.0�is  r%�
<listcomp>z_b32encode.<locals>.<listcomp>�s ��0�0�0�!�%���+�+�0�0�0r4c�$��g|]}�D]}||z���
SrArA)rD�a�b�b32tabs   �r%rFz_b32encode.<locals>.<listcomp>�s*���D�D�D��V�D�D��a�!�e�D�D�D�Dr4��r��i��
�s======i����r)s====����s===�����=���)�_b32tab2rrrrr-�	bytearray�int�
from_bytes�ranger0)	�alphabetr$�leftoverr3rZ�b32tab2rE�crJs	        @r%�
_b32encoder`�s�����x���0�0�x�0�0�0��D�D�D�D�V�D�D�D�������a��%�%�$��q�M�M�!�!�#�#���1�v�v��z�H��'�
���X��&�&���k�k�G���J��x� �G�
�1�c�!�f�f�a�
 �
 �����J�q��A��E��{�#�#���G�A��G�$��Q�"�W��-�.�/��Q�"�W��-�.�/��A��I�&�'�	����1�}�}� �������	�Q����������	�Q����������	�Q�����������>�>�r4c�4�|tvr!d�t|��D��t|<t|��}t|��dzrt	jd���|�jt|��}t|��dksJt
|�����|�t�	dd|z����}|r|�
��}t|��}|�d��}|t|��z
}t��}t|}tdt|��d��D]a}|||dz�}	d}
	|	D]}|
d	z||z}
�n##t$rt	jd
��d�wxYw||
�d	��z
}�b|dzs|dvrt	jd���|r9|r7|
d	|zz}
|
�d	��}dd	|zz
dz}
|d|
�|d
d�<t|��S)Nc��i|]\}}||��	SrArA)rD�k�vs   r%�
<dictcomp>z_b32decode.<locals>.<dictcomp>�s��B�B�B�d�a��Q��B�B�Br4�zIncorrect paddingrPs01�OrUrrKzNon-base32 digit found>rrPrRrT��+���)�_b32rev�	enumerater&r-r+�Errorr.r/r0r1�upper�rstriprXr[�KeyError�to_bytes)r\r$�casefold�map01�l�padchars�decoded�b32revrE�quanta�accr_�lastr]s              r%�
_b32decoder{�s=���w���B�B�i��.A�.A�B�B�B������"�"�A�
�1�v�v��z�2��n�0�1�1�1�
��'��.�.���5�z�z�Q�����U������
�K�K�����t�e�|�<�<�=�=����
�G�G�I�I��	�A���A�	������A��3�q�6�6�z�H��k�k�G�
�X�
�F�
�1�c�!�f�f�a�
 �
 �#�#���1�a�!�e�8�����	E��
-�
-���a�x�6�!�9�,���
-���	E�	E�	E��.�!9�:�:��D�	E�����3�<�<��?�?�"����1�u�2���/�/��n�0�1�1�1��'�G�'���H�����|�|�A������X��%�!�+���I�X�I���������>�>�s�#E7�7 Fc�,�tt|��S�N)r`�_b32alphabetr#s r%r	r	�s���l�A�&�&�&r4�base32)�encodingc�0�tt|||��Sr})r{r~)r$rrrss   r%r
r
�s���l�A�x��7�7�7r4)r��
extra_argsc�,�tt|��Sr})r`�_b32hexalphabetr#s r%rrs���o�q�)�)�)r4�	base32hexc�.�tt||��Sr})r{r��r$rrs  r%rrs���o�q�(�3�3�3r4�c�N�tj|�����S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r+�hexlifyrnr#s r%r
r
s!����A���$�$�&�&�&r4c���t|��}|r|���}tjd|��rt	jd���t	j|��S)a�Decode the Base16 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.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    s	[^0-9A-F]zNon-base16 digit found)r&rn�re�searchr+rm�	unhexlifyr�s  r%rrs\��	 ��"�"�A���
�G�G�I�I��	�y��q�!�!�7��n�5�6�6�6���a� � � r4s<~s~>c�������t|t��s!t|�����}t	|��dz}|r|d|zz}tjdt	|��dzz���|��}����fd�|D��}|r0|s.|ddkr�ddz|d<|dd|�|d<d	�|��S)
NrTrLz!%dIc�|��g|]8}�r|sdn/�r|dkrdn%�|dz�|dzdzz�|dzz��9S)�zi    �yi�^	�Ui9rA)rD�word�chars�chars2�foldnuls�
foldspacess  ����r%rFz_85encode.<locals>.<listcomp>:s����!�!�!�
��!�t�!�d�d� �!�T�Z�%7�%7�d�d��d�f�n�%��d�b�j�4�'�(�)��T�B�Y�� �!�!�!r4rVr�rrKr4)	rrrrr-�struct�Struct�unpack�join)	rIr�r��padr�r��padding�words�chunkss	 `` ``   r%�	_85encoder�0s�������a��%�%�$��q�M�M�!�!�#�#���A���w�!�m�G�� �
�������M�&�C��F�F�a�K�0�1�1�8�8��;�;�E�!�!�!�!�!�!�!�
 �!�!�!�F��+�s�+��"�:�����q��A��F�2�J��B�Z�	�'��	�*��r�
��8�8�F���r4)r��wrapcolr��adobec�����t�+d�tdd��D��ad�tD��at|tt|d|���|r
t�z��r�t|rdnd������fd	�td
t
������D��}|r1t
|d��dz�kr|�d��d
�|���|r
�tz
��S)a�Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    Nc�.�g|]}t|f����SrArBrCs  r%rFza85encode.<locals>.<listcomp>]s ��9�9�9�Q�U�A�4�[�[�9�9�9r4�!�vc�,�g|]}tD]}||z���SrA)�	_a85chars�rDrHrIs   r%rFza85encode.<locals>.<listcomp>^�)��D�D�D�!�)�D�D�Q�q�1�u�D�D�D�Dr4Tr)rPc�*��g|]}�||�z���SrArA)rDrE�resultr�s  ��r%rFza85encode.<locals>.<listcomp>fs6���;�;�;����A��K��(�;�;�;r4rrVr4�
)
�
_a85chars2r[r�r��	_A85START�maxr-�appendr��_A85END)rIr�r�r�r�r�r�s  `   @r%rrHs����(��9�9�%��C�.�.�9�9�9�	�D�D�y�D�D�D�
�
�q�)�Z��d�J�
G�
G�F��$��V�#���$��5�'�a�a�a��1�1��;�;�;�;�;� ��C��K�K��9�9�;�;�;���	#��6�"�:����"�W�,�,��
�
�c�"�"�"����F�#�#�����'����Mr4s 	

)r�r��ignorecharsc��t|��}|rp|�t��s'td�t�����|�t��r|dd�}n
|dd�}tjd��j	}g}|j
}g}|j
}|j}	|dzD]�}
d|
cxkrdkrwnnt||
��t|��d	krUd
}|D]
}
d|z|
dz
z}�	|||����n##tj
$rtd��d�wxYw|	����|
d
kr|rtd���|d����|r#|
dkr|rtd���|d����|
|vr��td|
z���d�|��}dt|��z
}
|
r|d|
�}|S)a�Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    z1Ascii85 encoded byte sequences must end with {!r}r)���N�!Isuuuur��urKrr�zAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %cr4rT)r&�endswithr�r�format�
startswithr�r�r��packr��clearr-�errorr�)rIr�r�r��packIrv�decoded_append�curr�curr_append�
curr_clear�xryr�r�s              r%rrqs\�� 	 ��"�"�A��	��z�z�'�"�"�	���"�F�7�O�O���
�
�<�<�	�"�"�	��!�B�$��A�A��#�2�#��A�

�M�$���$�E��G��^�N�
�D��+�K���J�
��\�@�@���a�"�"�"�"�7�"�"�"�"�"��K��N�N�N��4�y�y�A�~�~����.�.�A��s�(�a�"�f�-�C�C�C�"�N�5�5��:�:�.�.�.�.���|�C�C�C�$�%7�8�8�d�B�C�����
�����
�'�\�\��
=� �!;�<�<�<��N�;�'�'�'�'�
�	@�A��L�L��
=� �!;�<�<�<��N�.�/�/�/�/�
�+�
�
���:�Q�>�?�?�?�
�X�X�g�
�
�F��#�d�)�)�m�G��#��	�'��	�"���Ms�<D� D1sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~c��t�"d�tD��ad�tD��at|tt|��S)z�Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\0' so its length is a multiple of
    4 bytes before encoding.
    Nc�.�g|]}t|f����SrArBrCs  r%rFzb85encode.<locals>.<listcomp>�s ��7�7�7�Q�U�A�4�[�[�7�7�7r4c�,�g|]}tD]}||z���SrA)�	_b85charsr�s   r%rFzb85encode.<locals>.<listcomp>�r�r4)�
_b85chars2�_b85alphabetr�r�)rIr�s  r%rr�sD����7�7�,�7�7�7�	�D�D�y�D�D�D�
��Q�	�:�s�3�3�3r4c���t�*dgdzatt��D]\}}|t|<�t|��}t	|��dz}|d|zz}g}tjd��j}tdt	|��d��D]�}|||dz�}d}	|D]}|dzt|z}�nG#t$r:t|��D](\}}t|�td||zz��d��)�wxYw	|�||������#t
j$rtd	|z��d�wxYwd
�
|��}	|r|	d|�}	|	S)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�rK�~r�rr�z#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dr4)�_b85decrlr�r&r-r�r�r�r[r rr�r�r�)
rIrEr_r��outr��chunkry�jr�s
          r%rr�s������&�3�,���l�+�+�	�	�D�A�q��G�A�J�J���"�"�A��A���w�!�m�G�	�D�7�N��A�
�C��M�$���$�E�
�1�c�!�f�f�a�
 �
 �,�,���!�A��E�'�
����	��
,�
,���B�h����+���
,���	�	�	�!�%�(�(�
9�
9���1��1�:�%�$�%J�'(�1�u�&.�/�/�48�9�&�
�	����	,��J�J�u�u�S�z�z�"�"�"�"���|�	,�	,�	,��J� �!�"�"�'+�
,�	,�����X�X�c�]�]�F��#��	�'��	�"���Ms�'C�AD�D'�'#E
�LrTrRc�X�	|�t��}|sdSt|��tkrJ|�tt|��z
��}|sn||z
}t|��tk�Jtj|��}|�|����)z1Encode a file; input and output are binary files.TN)�read�
MAXBINSIZEr-r+r,�write)�input�outputr$�ns�lines     r%rr�s���
��J�J�z�"�"���	��E��!�f�f�z�!�!����J�s�1�v�v�-�.�.�B��
��
��G�A�	�!�f�f�z�!�!�
�"�1�%�%�����T����
r4c��	|���}|sdStj|��}|�|���B)z1Decode a file; input and output are binary files.TN)�readliner+r7r�)r�r�r�r$s    r%rrsG����~�~�����	��E����%�%�����Q����r4c�H�	t|��}n1#t$r$}d|jjz}t|��|�d}~wwxYw|jdvr&d|j�d|jj��}t|���|jdkr%d|j|jjfz}t|���dS)Nz"expected bytes-like object, not %s)r_rI�Bz#expected single byte elements, not z from rPz(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�M�����&�&�&�2�Q�[�5I�I����n�n�#�%�����&����	�x��&�&�&�+,�8�8�8�Q�[�5I�5I�K����n�n���v��{�{�9�+,�6�1�;�3G�*H�I����n�n���{s��
A�;�Ac��t|��g}tdt|��t��D];}|||tz�}|�tj|�����<d�|��S)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rr4)r�r[r-r�r�r+r,r�)r$�piecesrEr�s    r%rr%s}���a����
�F�
�1�c�!�f�f�j�
)�
)�2�2���!�a�*�n�$�%���
�
�h�)�%�0�0�1�1�1�1��8�8�F���r4c�H�t|��tj|��S)z8Decode a bytestring of base-64 data into a bytes object.)r�r+r7r#s r%rr0s!���a������q�!�!�!r4c���ddl}ddl}d|jdz}	|�|jdd�d��\}}nV#|j$rI}|j|_t
|��t
|��|�d��Yd}~nd}~wwxYwt}|D][\}}|dkrt}|dkrt}|d	krt}|d
krt��dS|dkrt
|��dS�\|rS|ddkrGt|dd
��5}	||	|jj��ddd��dS#1swxYwYdS||j
j|jj��dS)zSmall main programrNz�usage: %s [-h|-d|-e|-u|-t] [file|-]
        -h: print this help message and exit
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rP�hdeutr)z-ez-dz-uz-tz-h�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)
r�r��usage�opts�argsr��func�orH�fs
          r%�mainr�7s�����������
>�?B�h�q�k�	
J�E�
��]�]�3�8�A�B�B�<��9�9�
��d�d���<�����Z��
�
�c�
�
�
�
�e��������������������	����
�D��+�+���1���9�9�V�d���9�9�V�d���9�9�V�d���9�9�d�f�f�f�f�f�f���9�9�e�E�l�l�l�F�F�F�9��2��Q��3���
�$�q�'�4�
 �
 �	'�A��D��C�J�%�&�&�&�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	'�	'�	
��S�Y�
�s�z�0�1�1�1�1�1s)�&A�
B�?B�B� E�E�Ec��d}tt|����t|��}tt|����t|��}tt|����||ksJ�dS)NsAladdin:open sesame)r�r.rr)�s0�s1�s2s   r%r�r�Tsa��	�B�	�$�r�(�(�O�O�O�	�R���B�	�$�r�(�(�O�O�O�	�R���B�	�$�r�(�(�O�O�O�
��8�8�8�8�8�8r4�__main__r})NF)FN)F)FFF)9�__doc__r�r�r+�__all__r0rXrr&rrrrr1r<r>rr�_B32_ENCODE_DOCSTRING�_B32_DECODE_DOCSTRING�_B32_DECODE_MAP01_DOCSTRINGr~r�rWrkr`r{r	r�r
rrr
rr�r�r�r�r�rrr�r�r�r�rr�MAXLINESIZEr�rrr�rrr�r�r"rAr4r%�<module>r
st��K�J�
�	�	�	�
�
�
�
���������$�i� ��K�K�K�"����8�8�8�8�4������$�o�o�e�U�;�;��#�o�o�e�U�;�;��?�?�?�
�
�
�$��	����3��5��
��
��"�"�"�H,�,�,�,�^'�'�'�)�0�0�(�0�C�C�	��8�8�8�8�)�0�0�(�3N�1�P�P�	��*�*�*�,�3�3�[�3�I�I���4�4�4�4�-�3�3�[�?A�4�C�C���'�'�'�!�!�!�!�*
�	�
�
��	�
������0 %�a�U�%�'�'�'�'�'�R %�E�|�D�D�D�D�D�PE���	�
�
�
��4�4�4�4�'�'�'�Z���1�n�a�
�
�������
�
�
� ���"�"�"�2�2�2�:����z����D�F�F�F�F�F��r4

Hacked By AnonymousFox1.0, Coded By AnonymousFox