Rust port of a bsdiff library. High performance patching. All written in safe Rust.
let old = std::fs::read("old")?;
let new = std::fs::read("new")?;
let mut patch = Vec::new();
bsdiff::diff(&old, &new, &mut patch)?;
// TODO: compress `patch` here
std::fs::write("patch", &patch)?;
let old = std::fs::read("old")?;
let patch = std::fs::read("patch")?;
// TODO: decompress `patch` here
let mut new = Vec::new();
bsdiff::patch(&old, &mut patch.as_slice(), &mut new)?;
std::fs::write("new", &new)?;