import hashlib


def file_hash(filename):
    """Calculates the hash of an entire file on disk

    Args:
        filename (str)
            Location of file on disk

    Returns:
        hash (str)
            SHA256 checksum
    """
    hash_sha256 = hashlib.sha256()
    with open(filename, "rb") as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hash_sha256.update(chunk)
    return hash_sha256.hexdigest()