import hashlib


def calcFileSha256(filname):
    """calculate file sha256"""
    with open(filname, "rb") as f:
        sha256obj = hashlib.sha256()
        sha256obj.update(f.read())
        hash_value = sha256obj.hexdigest()
    return hash_value