import pathlib
import hashlib


def get_hash(file_path):
    """Return sha256 hash of file_path."""
    text = b""
    if (path := pathlib.Path(file_path)).is_file():
        text = path.read_bytes()
    return hashlib.sha256(text).hexdigest()