Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 864 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 864 Bytes

bsdiff-rs

Build status Cargo Link

Rust port of a bsdiff library. High performance patching. All written in safe Rust.

Diffing

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)?;

Patching

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)?;