import hashlib


def sha256(path):
    """Return the sha256 digest of a file."""
    h = hashlib.sha256()
    with open(path, 'rb') as f:
        for chunk in iter(lambda: f.read(8192), b''):
            if not chunk: break
            h.update(chunk)
    return h.hexdigest()