encodeSnapshotV2 = (snapshot, encoder = new DSEncoderV2()) => {
  writeDeleteSet(encoder, snapshot.ds);
  writeStateVector(encoder, snapshot.sv);
  return encoder.toUint8Array();
}
@param {Snapshot} snapshot
@param {DSEncoderV1 | DSEncoderV2} [encoder]
@return {Uint8Array}