Ë
    ��hl  ã                   ó–   — d dl Z d dlmZmZmZmZmZmZmZ d dl	m
Z
mZmZ d dlmZ erd dl mZ dZg d¢Z G d„ d	«      Z G d
„ de«      Zy)é    N)ÚTYPE_CHECKINGÚBinaryIOÚDictÚIterableÚListÚNoReturnÚOptional)ÚHashMismatchÚHashMissingÚInstallationError)Úread_chunks)Ú_HashÚsha256)r   Úsha384Úsha512c                   óü   — e Zd ZdZddeeeee   f      ddfd„Zdd„Z	e
defd„«       Zd	ed
edefd„Zdee   ddfd„Zdeedf   ddfd„Zdeddfd„Zdeddfd„Zdeeef   defd„Zdefd„Zdedefd„Zdefd„Zy)ÚHasheszaA wrapper that builds multiple hashes at once and checks them against
    known-good values

    NÚhashesÚreturnc                 ó¨   — i }|�B|j                  «       D ]/  \  }}t        |«      D �cg c]  }|j                  «       ‘Œ c}||<   Œ1 || _        yc c}w )zo
        :param hashes: A dict of algorithm names pointing to lists of allowed
            hex digests
        N)ÚitemsÚsortedÚlowerÚ_allowed)Úselfr   ÚallowedÚalgÚkeysÚks         úX/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pip/_internal/utils/hashes.pyÚ__init__zHashes.__init__   sW   € ð
 ˆØÐØ#Ÿ\™\›^ò A‘	��Tä39¸$³<Ö@¨a §¡¥	Ò@�˜’ðAð  ˆ�ùò  As   ¨AÚotherc                 ó  — t        |t        «      st        S |s| S | s|S i }|j                  j	                  «       D ]9  \  }}|| j                  vrŒ|D �cg c]  }|| j                  |   v sŒ|‘Œ c}||<   Œ; t        |«      S c c}w ©N)Ú
isinstancer   ÚNotImplementedr   r   )r   r"   Únewr   ÚvaluesÚvs         r    Ú__and__zHashes.__and__'   s’   € Ü˜%¤Ô(Ü!Ð!ñ ØˆKÙØˆLð ˆØ Ÿ>™>×/Ñ/Ó1ò 	F‰KˆC�Ø˜$Ÿ-™-Ñ'ØØ#)ÖE˜a¨Q°$·-±-ÀÑ2DÒ-DšÒEˆC�ŠHð	Fô �c‹{Ðùò Fs   ÁBÁ+Bc                 óV   — t        d„ | j                  j                  «       D «       «      S )Nc              3   ó2   K  — | ]  }t        |«      –— Œ y ­wr$   )Úlen)Ú.0Údigestss     r    ú	<genexpr>z&Hashes.digest_count.<locals>.<genexpr><   s   è ø€ ÒF G”3�w—<ÑFùs   ‚)Úsumr   r(   ©r   s    r    Údigest_countzHashes.digest_count:   s    € äÑF¨t¯}©}×/CÑ/CÓ/EÔFÓFÐFó    Ú	hash_nameÚ
hex_digestc                 ó>   — || j                   j                  |g «      v S )z/Return whether the given hex digest is allowed.)r   Úget)r   r5   r6   s      r    Úis_hash_allowedzHashes.is_hash_allowed>   s   € à˜TŸ]™]×.Ñ.¨y¸"Ó=Ð=Ð=r4   Úchunksc                 ó¨  — i }| j                   j                  «       D ]  }	 t        j                  |«      ||<   Œ |D ](  }|j                  «       D ]  }|j                  |«       Œ Œ* |j                  «       D ]&  \  }}|j                  «       | j                   |   v sŒ& y | j                  |«       y# t        t
        f$ r t        d|› �«      ‚w xY w)z‚Check good hashes against ones built from iterable of chunks of
        data.

        Raise HashMismatch if none match.

        zUnknown hash name: N)r   r   Úhashlibr'   Ú
ValueErrorÚ	TypeErrorr   r(   Úupdater   Ú	hexdigestÚ_raise)r   r:   Úgotsr5   ÚchunkÚhashÚgots          r    Úcheck_against_chunkszHashes.check_against_chunksB   sß   € ð ˆØŸ™×+Ñ+Ó-ò 	KˆIðKÜ")§+¡+¨iÓ"8��Y’ð	Kð ò 	#ˆEØŸ™›ò #�Ø—‘˜EÕ"ñ#ð	#ð #Ÿj™j›lò 	‰NˆI�sØ�}‰}‹ $§-¡-°	Ñ":Ò:Ùð	ð 	�‰�DÕøô ¤	Ð*ò KÜ'Ð*=¸i¸[Ð(IÓJÐJðKús   ¡B3Â3CrB   r   r   c                 ó.   — t        | j                  |«      ‚r$   )r
   r   ©r   rB   s     r    rA   zHashes._raiseY   s   € Ü˜4Ÿ=™=¨$Ó/Ð/r4   Úfilec                 ó6   — | j                  t        |«      «      S )zaCheck good hashes against a file-like object

        Raise HashMismatch if none match.

        )rF   r   )r   rI   s     r    Úcheck_against_filezHashes.check_against_file\   s   € ð ×(Ñ(¬°TÓ):Ó;Ð;r4   Úpathc                 óh   — t        |d«      5 }| j                  |«      cd d d «       S # 1 sw Y   y xY w)NÚrb)ÚopenrK   )r   rL   rI   s      r    Úcheck_against_pathzHashes.check_against_pathd   s1   € Ü�$˜Óð 	1 Ø×*Ñ*¨4Ó0÷	1÷ 	1ò 	1ús   �(¨1c                 ó\   — |j                  «       D ]  \  }}| j                  ||«      sŒ y y)z3Return whether any of the given hashes are allowed.TF)r   r9   )r   r   r5   r6   s       r    Ú
has_one_ofzHashes.has_one_ofh   s4   € à%+§\¡\£^ò 	Ñ!ˆI�zØ×#Ñ# I¨zÕ:Ùð	ð r4   c                 ó,   — t        | j                  «      S )z,Return whether I know any known-good hashes.)Úboolr   r2   s    r    Ú__bool__zHashes.__bool__o   s   € ä�D—M‘MÓ"Ð"r4   c                 ó`   — t        |t        «      st        S | j                  |j                  k(  S r$   )r%   r   r&   r   )r   r"   s     r    Ú__eq__zHashes.__eq__s   s%   € Ü˜%¤Ô(Ü!Ð!Ø�}‰} §¡Ñ.Ð.r4   c           	      ó†   — t        dj                  t        d„ | j                  j	                  «       D «       «      «      «      S )Nú,c              3   óV   K  — | ]!  \  }}|D ]  }d j                  ||f«      –— Œ Œ# y­w)ú:N)Újoin)r.   r   Údigest_listÚdigests       r    r0   z"Hashes.__hash__.<locals>.<genexpr>{   s>   è ø€ ò á(˜˜[Ø"-òð ð —H‘H˜c 6˜]×+ðØ+ñùs   ‚'))rD   r\   r   r   r   r2   s    r    Ú__hash__zHashes.__hash__x   s=   € ÜØ�H‰HÜñ à,0¯M©M×,?Ñ,?Ó,Aôó óó
ð 	
r4   r$   )r"   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   Ústrr   r!   r*   ÚpropertyÚintr3   rT   r9   r   ÚbytesrF   rA   r   rK   rP   rR   rU   ÚobjectrW   r_   © r4   r    r   r      s  „ ññ

 ˜x¨¨S°$°s±)¨^Ñ(<Ñ=ð 
 Èó 
 óð& ðG˜cò Gó ðGð>¨ð >¸#ð >À$ó >ð¨8°E©?ð ¸tó ð.0˜4  W Ñ-ð 0°*ó 0ð< xð <°Dó <ð1 sð 1¨tó 1ð  c¨3 h¡ð °Dó ð#˜$ó #ð/˜Fð / tó /ð
	
˜#ô 	
r4   r   c                   ó>   ‡ — e Zd ZdZdˆ fd„Zdeedf   ddfd„Zˆ xZS )	ÚMissingHasheszÀA workalike for Hashes used when we're missing a hash for a requirement

    It computes the actual hash of the requirement and raises a HashMissing
    exception showing it to the user.

    r   c                 ó2   •— t         ‰| �  t        g i¬«       y)z!Don't offer the ``hashes`` kwarg.)r   N)Úsuperr!   ÚFAVORITE_HASH)r   Ú	__class__s    €r    r!   zMissingHashes.__init__Œ   s   ø€ ô 	‰Ñ¤°Ð 3ÐÕ4r4   rB   r   r   c                 óB   — t        |t           j                  «       «      ‚r$   )r   rn   r@   rH   s     r    rA   zMissingHashes._raise’   s   € Ü˜$œ}Ñ-×7Ñ7Ó9Ó:Ð:r4   )r   N)	r`   ra   rb   rc   r!   r   rd   rA   Ú__classcell__)ro   s   @r    rk   rk   „   s)   ø„ ñõ5ð;˜4  W Ñ-ð ;°*÷ ;r4   rk   )r<   Útypingr   r   r   r   r   r   r	   Úpip._internal.exceptionsr
   r   r   Úpip._internal.utils.miscr   r   rn   ÚSTRONG_HASHESr   rk   ri   r4   r    ú<module>rv      sG   ðÛ ß T× TÑ Tç QÑ QÝ 0áÝð
 €ò
 /€÷l
ñ l
ô^;�Fõ ;r4   