import hashlib


def sha256_digest_from_generator(content_generator):
    """ Reads all of the data from the iterator and creates a sha256 digest from the content
  """
    digest = hashlib.sha256()
    for chunk in content_generator:
        digest.update(chunk)
    return "sha256:{0}".format(digest.hexdigest())