import hashlib


def get_sha256(path, chunk_size=1024 * 1024):
    """ Get the sha256 of a file """
    sha = hashlib.sha256()
    with open(path, "rb") as fin:
        data = fin.read(chunk_size)
        while data:
            sha.update(data)
            data = fin.read(chunk_size)
    return sha.hexdigest()