import hashlib


def sha1file(file: str) -> str:
    """
    Calculate the SHA1 hash of a file.

    Parameters
    ----------
    file : str
        The path to the file

    Returns
    -------
    str
        The SHA1 hash of the file
    """
    with open(file, "rb") as f:
        hash = hashlib.sha1()
        while True:
            data = f.read(1024)
            if not data:
                break
            hash.update(data)
        return hash.hexdigest()