o
    Y¨Êh   ã                   @   s’   d Z ddlZddlZddlZejd dkZereZeZ	ne
ZeZ	ee	fZzejZW n ey6   dd„ ZY nw eeddƒrCdd„ ZdS d	d„ ZdS )
z–
The `compat` module provides support for backwards compatibility with older
versions of python, and compatibility wrappers around optional packages.
é    Né   c                 C   sH   t | ƒt |ƒkr
dS d}t| |ƒD ]\}}|t|ƒt|ƒA O }q|dkS )zœ
        Returns True if the two strings are equal, False otherwise.

        The time taken is independent of the number of characters that match.
        Fr   )ÚlenÚzipÚord)Úval1Úval2ÚresultÚxÚy© r   ú</var/www/html/env/lib/python3.10/site-packages/jwt/compat.pyÚconstant_time_compare   s   r   Úto_bytesc                 C   s8   | }d}|dkr|d? }|d7 }|dks| j |ddd�S )Nr   é   é   ÚbigF)Úsigned)r   )ÚvalÚ	remainingÚbyte_lengthr   r   r   Úbytes_from_int.   s   þr   c                 C   sF   g }| rt | dƒ\} }| |¡ | s| ¡  tjdt|ƒ g|¢R Ž S )Né   z%sB)ÚdivmodÚappendÚreverseÚstructÚpackr   )r   ÚbufÚ	remainderr   r   r   r   8   s   
þ)Ú__doc__Úhmacr   ÚsysÚversion_infoÚPY3ÚstrÚ	text_typeÚbytesÚbinary_typeÚunicodeÚstring_typesÚcompare_digestr   ÚAttributeErrorÚgetattrÚintr   r   r   r   r   Ú<module>   s&    
þ
