import hashlib


def CalculateSha256Checksum(filename):
  """Calculate the sha256 checksum for filename."""

  sha = hashlib.sha256()

  with open(filename, 'rb') as f:
    data = f.read(65536)
    while len(data) > 0:
      sha.update(data)
      data = f.read(65536)

  return sha.hexdigest()