import pathlib
import hashlib


def compute_sha256(file: pathlib.Path) -> str:
    """Compute the SHA256 hash string of a file.

    Args:
        file (: pathlib.Path): File.

    Returns:
        str: SHA256 hash string.
    """
    with open(file, "rb") as file_handle:
        content = file_handle.read()
        return hashlib.sha256(content).hexdigest()