
    ߔ9iz                     @    d Z ddlmZ ddlmZmZ d	dedee   defdZy)
zFUtilities to efficiently compute the SHA 256 hash of a bunch of bytes.    )sha256)BinaryIOOptionalNfileobj
chunk_sizereturnc                     ||nd}t               }	 | j                  |      }|j                  |       |s	 |j                         S 6)a  
    Computes the sha256 hash of the given file object, by chunks of size `chunk_size`.

    Args:
        fileobj (file-like object):
            The File object to compute sha256 for, typically obtained with `open(path, "rb")`
        chunk_size (`int`, *optional*):
            The number of bytes to read from `fileobj` at once, defaults to 1MB.

    Returns:
        `bytes`: `fileobj`'s sha256 hash as bytes
    i   )r   readupdatedigest)r   r   shachunks       c/var/www/html/backtest/airagagent/rag_env/lib/python3.12/site-packages/huggingface_hub/utils/sha.pysha_fileobjr      sK      *5;J
(C
Z(

5::<     )N)	__doc__hashlibr   typingr   r   intbytesr    r   r   <module>r      s,    L  % x}  r   