o
    £i=hX  ã                   @   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
ddlmZmZ W n ey?   ddlmZmZ Y nw zejZW n eyR   dd„ ZY nw eeddƒr_d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é   )ÚIterableÚMappingc                 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   úB/var/www/html/loop/venv/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_int3   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   =   s   
þ)Ú__doc__Úhmacr   ÚsysÚversion_infoÚPY3ÚstrÚ	text_typeÚbytesÚbinary_typeÚunicodeÚstring_typesÚcollections.abcr   r   ÚImportErrorÚcollectionsÚcompare_digestr   ÚAttributeErrorÚgetattrÚintr   r   r   r   r   Ú<module>   s0    ÿ
þ
