import hashlib


def hash_file(fpath, block_size=2**16):
    """
    Get the SHA1 hash of a file.

    Args:
        fpath (str): Path to file.
        block_size (int): Number of bytes to read from the file at a time.

    Returns:
        str: hash
            SHA1 digest as a hex string.
    """
    hash_ = hashlib.sha1()
    with open(fpath, "rb") as f:
        while (buf := f.read(block_size)):
            hash_.update(buf)
    return hash_.hexdigest()