o
    Þý°j�  ã                   @   sD   d Z ddlZddlZddlmZ dd„ Zdd„ Zdd	„ Zd
d„ ZdS )z%Common functions for SelfTest modulesé    N)Úbc                 C   s   t  ¡  | ¡S )z�Return a list of TestCase instances given a TestCase class

    This is useful when you have defined test* methods on your TestCase class.
    )ÚunittestÚ
TestLoaderÚloadTestsFromTestCase)Úclass_© r   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/Cryptodome/SelfTest/st_common.pyÚlist_test_cases    s   r	   c                 C   s.   t | tƒrtd |  ¡ ¡ƒS tdƒ |  ¡ ¡S )z,Remove whitespace from a text or byte stringÚ )Ú
isinstanceÚstrr   ÚjoinÚsplit©Úsr   r   r   Ústrip_whitespace'   s   
r   c                 C   s   t  t| ƒ¡S )z2Convert hexadecimal to binary, ignoring whitespace)ÚbinasciiÚa2b_hexr   r   r   r   r   r   .   s   r   c                 C   s
   t  | ¡S )zConvert binary to hexadecimal)r   Úb2a_hexr   r   r   r   r   2   s   
r   )	Ú__doc__r   r   ÚCryptodome.Util.py3compatr   r	   r   r   r   r   r   r   r   Ú<module>   s   