+
    Bi                        R t ^ RIt^ RIt^ RIHt ]P
                   U u/ uF(  p V ]! ]V ]P                  ]P                  V 4      4      bK*  	  up t	 ^ RI
t
]	P                  R U u/ uF  p V ]! ]
V R4      bK  	  up 4       ]	P                  4        U Uu/ uF  w  rVf   K  WbK  	  upp t	RR ltR tR	R ltR
R ltR# u up i u up i u upp i   ] d     L-i ; i)z'
Calculating and checking file hashes.
N)Pathc           	        V\         9  d.   \        RV R\        \         P                  4       4       R24      hRpV\        P
                  9   d   \         V,          ! RR7      M\         V,          ! 4       p\        V R4      ;_uu_ 4       pVP                  V4      pV'       d%   VP                  V4       VP                  V4      pK,   RRR4       VP                  4       #   + '       g   i     TP                  4       # ; i)	a  
Calculate the hash of a given file.

Useful for checking if a file has changed or been corrupted.

Parameters
----------
fname : str
    The name of the file.
alg : str
    The type of the hashing algorithm

Returns
-------
hash : str
    The hash of the file.

Examples
--------

>>> fname = "test-file-for-hash.txt"
>>> with open(fname, "w") as f:
...     __ = f.write("content of the file")
>>> print(file_hash(fname))
0fc74468e6a9a829f103d069aeb2bb4f8646bad58bf146bb0e3379b759ec4a00
>>> import os
>>> os.remove(fname)

zAlgorithm 'zR' not available to the pooch library. Only the following algorithms are available .i   F)usedforsecurityrbN)
ALGORITHMS_AVAILABLE
ValueErrorlistkeyshashlibalgorithms_availableopenreadupdate	hexdigest)fnamealg	chunksizehasherfinbuffs   &&    J/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pooch/hashes.py	file_hashr   +   s    < &&# ;(--/014
 	
 I
 '... 	S!%8!#&( 
 
eT		cxx	"MM$88I&D  

  
	
 s   
C!$$C!!D 	c                    RpV f   TpVP                  4       # RV 9  d   TpVP                  4       # V P                  R4      ^ ,          pVP                  4       # )az  
Parse the name of the hash method from the hash string.

The hash string should have the following form ``algorithm:hash``, where
algorithm can be the name of any algorithm known to :mod:`hashlib`.

If the algorithm is omitted or the hash string is None, will default to
``"sha256"``.

Parameters
----------
hash_string : str
    The hash string with optional algorithm prepended.

Returns
-------
hash_algorithm : str
    The name of the algorithm.

Examples
--------

>>> print(hash_algorithm("qouuwhwd2j192y1lb1iwgowdj2898wd2d9"))
sha256
>>> print(hash_algorithm("md5:qouuwhwd2j192y1lb1iwgowdj2898wd2d9"))
md5
>>> print(hash_algorithm("sha256:qouuwhwd2j192y1lb1iwgowdj2898wd2d9"))
sha256
>>> print(hash_algorithm("SHA256:qouuwhwd2j192y1lb1iwgowdj2898wd2d9"))
sha256
>>> print(hash_algorithm("xxh3_64:qouuwhwd2j192y1lb1iwgowdj2898wd2d9"))
xxh3_64
>>> print(hash_algorithm(None))
sha256

sha256:)splitlower)hash_stringdefault	algorithms   &  r   hash_algorithmr!   `   sf    J G	
 ??	 
K		 ??  %%c*1-	??    c           
     6   Vf   R# \        V4      p\        WR7      pVP                  4       VP                  R4      R,          P                  4       8H  pV'       d=   V'       g5   Vf   \	        V 4      p\        VP                  4        RV RV RV R24      hV# )	a  
Check if the hash of a file matches a known hash.

If the *known_hash* is None, will always return True.

Coverts hashes to lowercase before comparison to avoid system specific
mismatches between hashes in the registry and computed hashes.

Parameters
----------
fname : str or PathLike
    The path to the file.
known_hash : str
    The known hash. Optionally, prepend ``alg:`` to the hash to specify the
    hashing algorithm. Default is SHA256.
strict : bool
    If True, will raise a :class:`ValueError` if the hash does not match
    informing the user that the file may be corrupted.
source : str
    The source of the downloaded file (name or URL, for example). Will be
    used in the error message if *strict* is True. Has no other use other
    than reporting to the user where the file came from in case of hash
    mismatch. If None, will default to *fname*.

Returns
-------
is_same : bool
    True if the hash matches, False otherwise.

T)r   r   z hash of downloaded file (z*) does not match the known hash: expected z	 but got zm. Deleted download for safety. The downloaded file may have been corrupted or the known hash may be outdated.)r!   r   r   r   strr   upper)r   
known_hashstrictsourcer    new_hashmatchess   &&&&   r   hash_matchesr,      s    > z*I.Hnn*"2"23"7";"A"A"CCGg>ZF !!;F8 D))3IhZ H//
 	
 Nr"   c                  a  \        S 4      o V'       d   RpMRp\        V 3R lS P                  V4       4       4      pV Uu. uF  p\        \	        S V,          4      4      NK   	  pp\        VRRR7      ;_uu_ 4       p\        WF4       F6  w  rXVP                  RP                  VP                  RR	4      V4      4       K8  	  R
R
R
4       R
# u upi   + '       g   i     R
# ; i)a  
Make a registry of files and hashes for the given directory.

This is helpful if you have many files in your test dataset as it keeps you
from needing to manually update the registry.

Parameters
----------
directory : str
    Directory of the test data to put in the registry. All file names in
    the registry will be relative to this directory.
output : str
    Name of the output registry file.
recursive : bool
    If True, will recursively look for files in subdirectories of
    *directory*.

z**/**c              3      <"   T F7  pVP                  4       '       g   K  \        VP                  S4      4      x  K9  	  R # 5i)N)is_filer%   relative_to).0path	directorys   & r   	<genexpr> make_registry.<locals>.<genexpr>   s6      +D<<> 	)DY'((+s
   A"Awzutf-8)encodingz{} {}
\/N)
r   sortedglobr   r%   r   zipwriteformatreplace)	r4   output	recursivepatternfilesr   hashesoutfilefhashs	   f&&      r   make_registryrH      s    & YI NN7+ E >CCUEiI-./UFC	fcG	,	,.LE MM)**5==s+CUKL / 
-	, D	,	,	,s   $C>ACC$	)xxh128xxh64xxh32xxh3_128xxh3_64)r   )FN)T)__doc__r   	functoolspathlibr   r   getattrpartialnewr   xxhashr   itemsImportErrorr   r!   r,   rH   )r   funcs   00r   <module>rX      s      +++ #y00cB	CC+ 
	  K	
J d++J	
 $8#=#=#?#?ic4		#?2j,^-`%M[	
  		s;   .B=C $C8C CC%C C CC