code: def hash(file):
      
  
      exists(file)
      log(_("hashing {}...").format(file))
  
      # https://stackoverflow.com/a/22058673
      with open(file, "rb") as f:
          sha256 = hashlib.sha256()
          for block in iter(lambda: f.read(65536), b""):
              sha256.update(block)
          return sha256.hexdigest()
docs: Hashes file using SHA-256.
  
      :param file: name of file to be hashed
      :type file: str
      :rtype: str
      :raises check50.Failure: if ``file`` does not exist