ó
    Þ jl  ã                   ó    • S SK r S SKJrJrJrJrJrJrJr  S SK	J
r
JrJr  S SKJr  \(       a  S SK Jr  Sr/ SQr " S S	5      r " S
 S\5      rg)é    N)ÚTYPE_CHECKINGÚBinaryIOÚDictÚIterableÚListÚNoReturnÚOptional)ÚHashMismatchÚHashMissingÚInstallationError)Úread_chunks)Ú_HashÚsha256)r   Úsha384Úsha512c                   ó  • \ rS rSrSrSS\\\\\   4      SS4S jjr	SS jr
\S\4S	 j5       rS
\S\S\4S jrS\\   SS4S jrS\\S4   SS4S jrS\SS4S jrS\SS4S jrS\\\4   S\4S jrS\4S jrS\S\4S jrS\4S jrSrg)ÚHashesé   zYA wrapper that builds multiple hashes at once and checks them against
known-good values

NÚhashesÚreturnc                 óª   • 0 nUbC  UR                  5        H/  u  p4[        U5       Vs/ sH  oUR                  5       PM     snX#'   M1     X l        gs  snf )zW
:param hashes: A dict of algorithm names pointing to lists of allowed
    hex digests
N)ÚitemsÚsortedÚlowerÚ_allowed)Úselfr   ÚallowedÚalgÚkeysÚks         ÚT/var/www/html/gaurav/venv/lib/python3.13/site-packages/pip/_internal/utils/hashes.pyÚ__init__ÚHashes.__init__   sL   € ð
 ˆØÑØ#Ÿ\™\ž^‘	�ä39¸$´<Ó@±<¨a§¡¦	±<Ñ@�“ñ ,ð  �ùò  As   ¨AÚotherc                 ó8  • [        U[        5      (       d  [        $ U(       d  U $ U (       d  U$ 0 nUR                  R	                  5        H>  u  p4X0R                  ;  a  M  U Vs/ sH  oUU R                  U   ;   d  M  UPM     snX#'   M@     [        U5      $ s  snf ©N)Ú
isinstancer   ÚNotImplementedr   r   )r   r$   Únewr   ÚvaluesÚvs         r!   Ú__and__ÚHashes.__and__'   sŠ   € Ü˜%¤×(Ñ(Ü!Ð!ö ØˆKÞØˆLð ˆØ Ÿ>™>×/Ñ/Ö1‰KˆCØŸ-™-Ó'ÙÙ#)ÓE¡6˜a°$·-±-ÀÑ2DÑ-DŸ¡6ÑEˆC‹Hñ 2ô �c‹{Ðùò Fs   Á$BÁ=Bc                 óV   • [        S U R                  R                  5        5       5      $ )Nc              3   ó6   #   • U H  n[        U5      v •  M     g 7fr&   )Úlen)Ú.0Údigestss     r!   Ú	<genexpr>Ú&Hashes.digest_count.<locals>.<genexpr><   s   é € ÐFÑ/E G”3�w—<�<Ò/Eùs   ‚)Úsumr   r*   ©r   s    r!   Údigest_countÚHashes.digest_count:   s    € äÑF¨t¯}©}×/CÑ/CÔ/EÓFÓFÐFó    Ú	hash_nameÚ
hex_digestc                 ó>   • X R                   R                  U/ 5      ;   $ )z/Return whether the given hex digest is allowed.)r   Úget)r   r:   r;   s      r!   Úis_hash_allowedÚHashes.is_hash_allowed>   s   € àŸ]™]×.Ñ.¨y¸"Ó=Ñ=Ð=r9   Úchunksc                 ó¼  • 0 nU R                   R                  5        H  n [        R                  " U5      X#'   M     U H+  nUR                  5        H  nUR                  U5        M     M-     UR                  5        H(  u  p6UR                  5       U R                   U   ;   d  M(    g   U R                  U5        g! [        [
        4 a    [        SU 35      ef = f)zjCheck 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@   Úgotsr:   ÚchunkÚhashÚgots          r!   Úcheck_against_chunksÚHashes.check_against_chunksB   sÅ   € ð ˆØŸ™×+Ñ+Ö-ˆIðKÜ")§+¢+¨iÓ"8�“ñ .ó ˆEØŸ™ž�Ø—‘˜EÖ"ó &ñ ð #Ÿj™jžl‰NˆIØ�}‰}‹ $§-¡-°	Ñ":Õ:Ùñ +ð 	�‰�DÕøô ¤	Ð*ó KÜ'Ð*=¸i¸[Ð(IÓJÐJðKús   ¡B<Â<CrH   r   r   c                 ó.   • [        U R                  U5      er&   )r
   r   ©r   rH   s     r!   rG   ÚHashes._raiseY   s   € Ü˜4Ÿ=™=¨$Ó/Ð/r9   Úfilec                 ó6   • U R                  [        U5      5      $ )zQCheck good hashes against a file-like object

Raise HashMismatch if none match.

)rL   r   )r   rQ   s     r!   Úcheck_against_fileÚHashes.check_against_file\   s   € ð ×(Ñ(¬°TÓ):Ó;Ð;r9   Úpathc                 ór   • [        US5       nU R                  U5      sS S S 5        $ ! , (       d  f       g = f)NÚrb)ÚopenrS   )r   rU   rQ   s      r!   Úcheck_against_pathÚHashes.check_against_pathd   s(   € Ü�$˜Ô Ø×*Ñ*¨4Ó0÷ ××ús   �(¨
6c                 óf   • UR                  5        H  u  p#U R                  X#5      (       d  M    g   g)z3Return whether any of the given hashes are allowed.TF)r   r>   )r   r   r:   r;   s       r!   Ú
has_one_ofÚHashes.has_one_ofh   s.   € à%+§\¡\¦^Ñ!ˆIØ×#Ñ# I×:Ó:Ùñ &4ð r9   c                 ó,   • [        U R                  5      $ )z,Return whether I know any known-good hashes.)Úboolr   r6   s    r!   Ú__bool__ÚHashes.__bool__o   s   € ä�D—M‘MÓ"Ð"r9   c                 ój   • [        U[        5      (       d  [        $ U R                  UR                  :H  $ r&   )r'   r   r(   r   )r   r$   s     r!   Ú__eq__ÚHashes.__eq__s   s(   € Ü˜%¤×(Ñ(Ü!Ð!Ø�}‰} §¡Ñ.Ð.r9   c           	      ó†   • [        SR                  [        S U R                  R	                  5        5       5      5      5      $ )NÚ,c              3   óZ   #   • U H"  u  pU H  nS R                  X45      v •  M     M$     g7f)Ú:N)Újoin)r1   r   Údigest_listÚdigests       r!   r3   Ú"Hashes.__hash__.<locals>.<genexpr>{   s5   é € ð á,AÑ(˜Û"-˜ð —H‘H˜c˜]×+Ð+á"-ñ ,Ú,Aùs   ‚)+)rJ   ri   r   r   r   r6   s    r!   Ú__hash__ÚHashes.__hash__x   s=   € ÜØ�H‰HÜñ à,0¯M©M×,?Ñ,?Ô,Aóó óó
ð 	
r9   )r   r&   )r$   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r	   r   Ústrr   r"   r,   ÚpropertyÚintr7   r_   r>   r   ÚbytesrL   rG   r   rS   rY   r\   r`   Úobjectrc   rm   Ú__static_attributes__© r9   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ô /ð
	
˜#÷ 	
r9   r   c                   óL   ^ • \ rS rSrSrS
U 4S jjrS\\S4   SS4S jrS	r	U =r
$ )ÚMissingHashesé„   z´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                 ó,   >• [         TU ]  [        / 0S9  g)z!Don't offer the ``hashes`` kwarg.)r   N)Úsuperr"   ÚFAVORITE_HASH)r   Ú	__class__s    €r!   r"   ÚMissingHashes.__init__Œ   s   ø€ ô 	‰Ñ¤°Ð 3ÐÒ4r9   rH   r   r   c                 óB   • [        U[           R                  5       5      er&   )r   r€   rF   rO   s     r!   rG   ÚMissingHashes._raise’   s   € Ü˜$œ}Ñ-×7Ñ7Ó9Ó:Ð:r9   rz   )r   N)ro   rp   rq   rr   rs   r"   r   rt   rG   ry   Ú__classcell__)r�   s   @r!   r|   r|   „   s.   ø† ñ÷5ð;˜4  W Ñ-ð ;°*÷ ;ò ;r9   r|   )rB   Útypingr   r   r   r   r   r   r	   Úpip._internal.exceptionsr
   r   r   Úpip._internal.utils.miscr   r   r€   ÚSTRONG_HASHESr   r|   rz   r9   r!   Ú<module>rŠ      sG   ðÛ ß T× TÑ Tç QÑ QÝ 0æÝð
 €ò
 /€÷l
ñ l
ô^;�Fõ ;r9   