import hashlib


def checksum(fname):
    """Calculates a SHA256 digest of the given file name."""
    m = hashlib.sha256()
    with open(fname, "r", encoding="utf-8") as mk:
        m.update(mk.read().encode("utf-8"))
    return m.hexdigest()