add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
�

�WcIc
s
�dZddlZ	ddlZddlZddlZ	ddl
Z
ddlmZ
ddlmZe
j"ed�	�e	j&e	j(zd
zZe
�ZGd�dedd
��Zd%dd�d�Zd%d�ZgZdd�d�Zedddd�edddd�dD]Zeddezddee�zd��s�eddd d!�ed"dd#d$�[[dS#e$r#ej
dkr	ed��ed��wxYw)&zEWrapper to the POSIX crypt library call and associated functionality.�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuple)i�
)Zremovez./cs�eZdZdZd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cs:�dj|j�S)Nz<crypt.METHOD_{}>)Zformat�name)Zselfs �/usr/lib64/python3.12/crypt.py�__repr__z_Method.__repr__ s��"�)�)�$�)�)�4�4�N)�__name__Z
__module__Z__qualname__�__doc__r�rrrrs-������(�(�5�5�5�5�5rrz name ident salt_chars total_size��roundscs��|�
td}|�7t|t�s$t|jj
�d���|jsd}nd|j�d�}|jr}|jddkrg|�d}nXtj|dz
�}|d|zkr
td	��d
|cxkrdkstd��td��||d
�d�z
}nT|jdvr4|�Dd|cxkrdkstd��td��|d|�d�z
}n|�t|�d���|djd�t|j�D��z
}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    Nrz+ object cannot be interpreted as an integer�z$�2iizrounds must be a power of 2iiz%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentc3sPK�|] }tjt����"dS�N)�_srZchoice�
_saltchars)Z.0Zchar�  rz	<genexpr>zmksalt.<locals>.<genexpr>Fs+����M�M�D����J�'�'�'�'�'�M�Mr)�methods�
isinstanceZintZ	TypeErrorZ	__class__r	ZidentZ
bit_lengthZ
ValueErrorZjoinZrangeZ
salt_chars)�methodr
ZsZ
log_roundss    r�mksaltr$s����~�����
��*�V�S�"9�"9��6�+�+�4�4�5�5�5�6�	6��<�<�<������������
�|�|�|����Q��3�.�.��>��J�J�����q��1�J���j��(�(� �!>�?�?��
�(�(�(�(�b�(�(� �!H�I�I�)� �!H�I�I�	�
�
!�
!�
!�
!�!���	����	#�	#����6�0�0�0�0�[�0�0� �!N�O�O�1� �!N�O�O�
�$�6�$�$�$�$�A�A�	�	��F�H�H�H�I�I�����M�M�E�&�:K�:K�4L�M�M�	M�M�A��Hrcsv�|�t|t�r
t|�}tj||�S)aRReturn a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    )rrr�_crypt�crypt)Zword�saltrrrrJs/���|�z�$��0�0��d�|���<�<��d�#�#rcs��t|g|�R�}|t�d|z<t||��}d}	td|�}|r4t|�|jkrtj|�dSdS#t$rJ}|j
t
jt
jt
jhvrYd}~dS�d}~wwxYw)NZMETHOD_rrFT)
rZglobalsrrZOSError�errnoZEINVALZEPERMZENOSYS�lenZ
total_sizerZappend)rr
ZargsrrZresultZes       r�_add_methodr\s���
�T�
!�D�
!�
!�
!�F�"(�G�I�i�$����&��(�(�D�
�F���r�4����v�#�f�+��!2�!2�2�2����v����t��5�������7�7�u�|�|�U�[�[�%�,�,�?�?�?��5�5�5�5�5�
�����	���s�A8�8
C�>C�C�CZSHA512riijZSHA256ri?)ZbZyZarZBLOWFISHrii;ZMD5Z1ii"ZCRYPTirr)r
ZsysZ_sysrZModuleNotFoundErrorZplatformZImportErrorrZstringZ_stringZwarningsZrandomrZ
_SystemRandomZcollectionsrZ_namedtupleZ_deprecatedr	Z
ascii_lettersZdigitsrrrrrrrZ_vrrrr�<module>r s��K�K�����Y��M�M�M�
������������0�0�0�0�0�0�1�1�1�1�1�1�����X�g�.�.�.��
"�
"�W�^�^�
3�d�
:�
��m�o��5�5�5�5�5�k�k�)�%G�H�5�5�#
�$�#
�#
�#
�#
�#
�L$�$�$�$� 
��$(������"��H�c�2�s�#�#���H�c�2�r�"�"����B��{�:�s�R�x��R�#�#�b�'�\�$�G�G�G��
���E�3��2�����G�T�1�b�!�!������k�Y�Y�Y��}�}�����k�H�I�I��k�W�X�X�	Y���s�C�(D