import hashlib


def file_sha256(file_path: str, chunk_size: int = 65536) -> str:
    """Computes sha256 hash of file

    Parameters
    ----------
    file_path : str
        path to file
    chunk_size : int
        size in bytes to be read at a time, -1 for reading whole contents

    Returns
    -------
    str
        sha256 hash as a hex string

    """
    assert chunk_size != 0,\
        'chunk_size must not equal 0'

    checksum = hashlib.sha256()

    with open(file_path, 'rb') as file:
        chunk = file.read(chunk_size)
        while len(chunk) != 0:
            checksum.update(chunk)
            chunk = file.read(chunk_size)

    return checksum.hexdigest()