%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/__pycache__/base64.cpython-312.pyc

�

���fzP��`�dZddlZddlZddlZgd�ZeefZd�Zd5d�Z	d6d�Z
d�Zd	�Zejd
d�Zejdd
�Zd�Zd
�ZdZdZdZdZdZiaiad�Zd7d�Zd�Zej9d��e_d7d�Zej9de��e_d�Zej9d��e_d8d�Zej9dd��e_d�Z d8d�Z!da"da#d Z$d!Z%d9d"�Z&ddddd#�d$�Z'ddd%d&�d'�Z(d(Z)da*da+da,d8d)�Z-d*�Z.d+Z/e/d,zd-zZ0d.�Z1d/�Z2d0�Z3d1�Z4d2�Z5d3�Z6e7d4k(re6�yy):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�.�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 �/usr/lib/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��}|�Ct|�dk(sJt|���|j	t
j
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)�newline��+/)�binascii�
b2a_base64�len�repr�	translate�bytes�	maketrans)r$�altchars�encodeds   r%rr3sX���!�!�!�U�3�G����8�}��!�1�4��>�1�!�� � ������!A�B�B��N�Fc���t|�}|�Nt|�}t|�dk(sJt|���|jtj|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
    r)r*)�strict_mode)r&r-r.r/r0r1r+�
a2b_base64)r$r2�validates   r%rrAse��$	 ��"�A���*�8�4���8�}��!�1�4��>�1�!�
�K�K�����%�8�9�����q�h�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�>�t|�jt�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�X�t|�}|jt�}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�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�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����r)s====����s===�����=���)�_b32tab2r0rrrrr-�	bytearray�int�
from_bytes�range)�alphabetr$�i�b32tab�a�b�leftoverr3rO�b32tab2�cs           r%�
_b32encoderY�s����x��'/�0�!�%���+�0��0�-3�D��V�D��a�!�e�D�e�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��|�Qt|�}t|�dk(sJt
|���|jtjdd|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�}dd|zz
dz}|d||ddt|�Scc}}w#t$rt	j
d	�d�wxYw)
N�zIncorrect paddingrEs01�OrJrr@zNon-base32 digit found>rrErGrI��+���)�_b32rev�	enumerater&r-r+�Errorr.r/r0r1�upper�rstriprMrP�KeyError�to_bytes)rQr$�casefold�map01�k�v�l�padchars�decoded�b32revrR�quanta�accrX�lastrVs                r%�
_b32decoderr�s����w��.7��.A�B�d�a��Q��T�B������"�A�
�1�v��z��n�n�0�1�1�
��'��.���5�z�Q��+��U��+��
�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+�+ Gc�"�tt|�S�N)rY�_b32alphabetr#s r%r	r	�s���l�A�&�&r4�base32)�encodingc�&�tt|||�Srt)rrru)r$rgrhs   r%r
r
�s���l�A�x��7�7r4)rw�
extra_argsc�"�tt|�Srt)rY�_b32hexalphabetr#s r%rrs���o�q�)�)r4�	base32hexc�$�tt||�Srt)rrr{�r$rgs  r%rrs���o�q�(�3�3r4�c�H�tj|�j�S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r+�hexlifyrcr#s r%r
r
s�����A��$�$�&�&r4c��t|�}|r|j�}tjd|�rt	j
d��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&rc�re�searchr+rb�	unhexlifyr~s  r%rrsK��	 ��"�A��
�G�G�I��	�y�y��q�!��n�n�5�6�6����a� � r4s<~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)NrIrAz!%dI�zi    �yi�^	�Ui9rKrr@r4)	rrrrr-�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�� �!�!�F�!��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)
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.
    �!�vTr)rErrKr4�
)�
_a85chars2rPr0�	_a85charsr��	_A85START�maxr-�appendr��_A85END)	rUr�r�r�r�rRrT�resultr�s	         r%rrHs��(��*/��C�.�9�Q�U�A�4�[�9�	�'0�D�!�)�D�Q�q�1�u�D�u�D�
�
�q�)�Z��d�J�
G�F���V�#����5�a�a��1�� ��C��K��9�;����A��K�(�;��;���6�"�:���"�W�,��
�
�c�"����F�#����'����M��%:��D��;s�C2�C7�C=s 	

)r�r��ignorecharsc�0�t|�}|rS|jt�stdj	t���|jt�r|dd}n|dd}tjd�j}g}|j}g}|j}|j}	|dzD]�}
d|
cxkrdkrEnnB||
�t|�d	k(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)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��ur@rr�zAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %cr4rI)r&�endswithr�r�format�
startswithr�r�r��packr��clearr-�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�*E5�5 FsU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~c���t�BtD�cgc]}t|f���c}atD��cgc]}tD]}||z��	�c}}at	tt|�Scc}wcc}}w)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.
    )�
_b85chars2�_b85alphabetr0�	_b85charsr�)rUr�rRrTs    r%rr�sY����*6�7�Q�U�A�4�[�7�	�'0�D�!�)�D�Q�q�1�u�D�u�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)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�r@�~r�rr�z#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dr4)�_b85decrar�r&r-r�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���	�!�%�(�
9���1��1�:�%�$�%J�'(�1�u�&.�/�48�9�
9�
�	���|�|�	,��J� �!�"�'+�
,�	,�s�C �,D� #D�D�#D?�LrIrGc��|jt�x}r�t|�tkr^|jtt|�z
�x}r;||z
}t|�tkr$|jtt|�z
�x}r�;tj|�}|j|�|jt�x}r��yy)z1Encode a file; input and output are binary files.N)�read�
MAXBINSIZEr-r+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�*�%�
%�!�
%r4c��|j�x}r:tj|�}|j|�|j�x}r�9yy)z1Decode a file; input and output are binary files.N)�readliner+r7r�)r�r�r�r$s    r%rrsC���.�.�"�
"�$�
"�����%�����Q���.�.�"�
"�$�
"r4c��	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 rEz(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)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rr4)r�rPr-r�r�r+r,r�)r$�piecesrRr�s    r%rrse���a��
�F�
�1�c�!�f�j�
)�2���!�a�*�n�%���
�
�h�)�)�%�0�1�2��8�8�F��r4c�B�t|�tj|�S)z8Decode a bytestring of base-64 data into a bytes object.)r�r+r7r#s r%rr's���a�����q�!�!r4c��ddl}ddl}d|jd�d�}	|j|jddd�\}}t}D]8\}}|dk(rt}|d	k(rt}|d
k(rt}|dk(s�-t
|�yr>|ddk7r6t|dd
�5}	||	|j
j�ddd�y||jj|j
j�y#|j$rC}|j|_t
|�t
|�|jd�Yd}~��d}~wwxYw#1swYyxYw)zSmall main programrNzusage: zx [-h|-d|-e|-u] [file|-]
        -h: print this help message and exit
        -d, -u: decode
        -e: encode (default)rE�hdeur)z-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�.s6���������}�%�
 �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#�"C4�E	�4E�8E�E�	E�__main__rt)NF)FN)F)FFF)8�__doc__r�r�r+�__all__r0rMrr&rrrrr1r<r>rr�_B32_ENCODE_DOCSTRING�_B32_DECODE_DOCSTRING�_B32_DECODE_MAP01_DOCSTRINGrur{rLr`rYrrr	r�r
rrr
rr�r�r�r�r�rrr�r�r�r�rr�MAXLINESIZEr�rrr�rrr�r"�r4r%�<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�r4

Zerion Mini Shell 1.0