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)
Read blocks from a buffer and update a hash with them.
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/storage/_helpers.py/_write_buffer_to_hash