code: def _write_buffer_to_hash(buffer_object, hash_obj, digest_block_size=8192):
      
      block = buffer_object.read(digest_block_size)
  
      while len(block) > 0:
          hash_obj.update(block)
          # Update the block for the next iteration.
          block = buffer_object.read(digest_block_size)
docs: Read blocks from a buffer and update a hash with them.
  
      :type buffer_object: bytes buffer
      :param buffer_object: Buffer containing bytes used to update a hash object.
  
      :type hash_obj: object that implements update
      :param hash_obj: A hash object (MD5 or CRC32-C).
  
      :type digest_block_size: int
      :param digest_block_size: The block size to write to the hash.
                                Defaults to 8192.