Yet another one tools lib for operations with binary data.
Calculate diff and create patch for two streams:
using System.IO;
using System.Threading.Tasks;
using BitSoft.BinaryTools.Patch;
public async ValueTask CreatePatchAsync(Stream source, Stream target, Stream output, CancellationToken token)
{
await BinaryPatch.CreateAsync(source, target, output, cancellationToken: token);
}Apply patch to a source stream:
using System.IO;
using System.Threading.Tasks;
using BitSoft.BinaryTools.Patch;
public async ValueTask ApplyPatchAsync(Stream source, Stream patch, Stream output, CancellationToken token)
{
await BinaryPatch.ApplyAsync(source, patch, output, cancellationToken: token);
}Benchmarks you can find here.