Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/time_hashlib.cpython-311.opt-1.pyc
�

�Ke����ddlZddlZddlZd�Zd�Zd�Zd�ZejdZedvr.e	dez��e	d	ezd
z��e
ded���ned
kraeej��dkrMddlZe	dejdz��e
dejdze
eejd����n�ed
krKeej��dkr7ddlZe	dejdz��e
dejdz��ndeee��r<ee
ee��d��r&e
ee��Ze
deze
ee����ne	dez��e
dez��	e��n`#e$rXe
��e
d��e
d��e
d��e
d��e
d��e
d��e
���wxYwe��edd� ��ed!d"� ��ed#d$� ��ed%d&� ��ed'd(� ��ed)d*� ��ed+d,� ��ee��jd-� ��ed.d/� ��dS)0�Nc� �td���)Nzeek, creatorFunc not overridden)�RuntimeError���;/usr/local/apps/python3/lib/python3.11/test/time_hashlib.py�creatorFuncr	s��
�8�
9�
9�9rc	�(�d|zdz}d|z}t}tj��}t|��D]}||�����}� tj��}td||z
zd|dt
|��d|��dS)N�ٞ��Z�%2.2f�seconds�x�bytes)r�time�perf_counter�range�digest�print�len)	�scale�name�
iterations�longStr�localCF�start�fr�ends	         r�test_scaled_msgrs�������#�J��5�j�G��G�����E�
�:�
�
�&�&���G�G���#�#�%�%���
�
�
�
�C�	�7�c�%�i� �9�j�#�s�7�|�|�W�VZ�[�[�[�[�[rc��tj��}td��D]}t��}�tj��}t	d||z
zdd��dS)N� Nr
rz[20000 creations])rrrrr)rr�drs    r�test_creater#s`������E�
�5�\�\�����M�M���
�
�
�
�C�	�7�c�%�i� �9�.A�B�B�B�B�Brc���tj��}td��D]"}t�����}�#tj��}td||z
zdd��dS)Nr!r
rz[20000 "" digests])rrrrrr)rrrrs    r�	test_zeror% sl������E�
�5�\�\�#�#���M�M� � �"�"���
�
�
�
�C�	�7�c�%�i� �9�.B�C�C�C�C�Cr�)�_md5�_shazimport zcreatorFunc = z.newztesting speed of oldzlegacy interface�_hashlib�zcreatorFunc = _hashlib.%s�ztesting speed of _hashlib.%sz+creatorFunc = lambda x=_hashlib.new : x(%r)z!testing speed of _hashlib.new(%r)�__call__ztesting speed of hashlib.z*creatorFunc = lambda x=hashlib.new : x(%r)z testing speed of hashlib.new(%r)z8pass argument(s) naming the hash to run a speed test on:z6 '_md5' and '_sha' test the legacy builtin md5 and shaz= '_hashlib' 'openssl_hName' 'fast' tests the builtin _hashlibz6 '_hashlib' 'hName' tests builtin _hashlib.new(shaFOO)z> 'hName' tests the hashlib.hName() implementation if it existsz.         otherwise it uses hashlib.new(hName).r
z[huge data])rri|)z[large data]i&z
[medium data]i�z[4*small data]iPz[3*small data]��z[2*small data]�jz[small data]z[digest_size data]�
z[tiny data])�sysr�hashlibrrr#r%�argv�hName�execrrr)�getattr�hasattr�
ValueError�digest_sizerrr�<module>r9s����
�
�
���������:�:�:�
\�
\�
\�C�C�C�D�D�D�	�����
	�����D��5������D�	�%�	��	&�'�'�'�	�E�
 �%�);�<�<�<�<�
�j���S�S���]�]�Q�.�.��O�O�O��D�	$�s�x��{�	2�3�3�3�	�E�
(�3�8�A�;�
6����#�(�ST�+�8V�8V�W�W�W�W�
�j���S�S���]�]�a�/�/��O�O�O��D�	6���!��	D�E�E�E�	�E�
-�����
;�<�<�<�<��W�W�e���6������%�)@�)@�*�!M�!M�6��'�'�5�)�)�K�	�E�
%�e�
+�W�W�W�e�-D�-D�E�E�E�E��D�	5��	=�>�>�>�	�E�
,�u�
4�5�5�5�
��K�M�M�M�M���	
�	
�	
�	�E�G�G�G�	�E�
D�E�E�E�	�E�
B�C�C�C�	�E�
I�J�J�J�	�E�
B�C�C�C�	�E�
J�K�K�K�	�E�
:�;�;�;�	�E�G�G�G�	�	
����
�	������f�=�1�1�1�1���e�.�1�1�1�1���d��1�1�1�1���c� 0�1�1�1�1���c� 0�1�1�1�1���c� 0�1�1�1�1���c��/�/�/�/���k�k�m�m�/�6J�K�K�K�K���b�}�-�-�-�-�-�-s
�5
F�AG