docs: def hash_file(file_like_object, hash_algo='md5'):
      """Generate a hash for the contents of a file.
  
      It returns a hash of the file object as a string of double length,
      containing only hexadecimal digits. It supports all the algorithms
      hashlib does.
      :param file_like_object: file like object whose hash to be calculated.
      :param hash_algo: name of the hashing strategy, default being 'md5'.
      :raises: InvalidInputError, on unsupported or invalid input.
      :returns: a condensed digest of the bytes of contents.
      """
      checksum = _get_hash_object(hash_algo)
      for chunk in iter(lambda: file_like_object.read(32768), b''):
          checksum.update(chunk)
      return checksum.hexdigest()