docs: def compute_checksum(stream, algo, message_digest, chunk_size=None,
                       progress_callback=None):
      """Get helper method to compute checksum from a stream.
  
      :param stream: File-like object.
      :param algo: Identifier for checksum algorithm.
      :param messsage_digest: A message digest instance.
      :param chunk_size: Read at most size bytes from the file at a time.
      :param progress_callback: Function accepting one argument with number
          of bytes read. (Default: ``None``)
      :returns: The checksum.
      """
      chunk_size = chunk_size_or_default(chunk_size)
  
      bytes_read = 0
      while 1:
          chunk = stream.read(chunk_size)
          if not chunk:
              if progress_callback:
                  progress_callback(bytes_read)
              break
          message_digest.update(chunk)
          bytes_read += len(chunk)
          if progress_callback:
              progress_callback(bytes_read)
      return "{0}:{1}".format(algo, message_digest.hexdigest())