#patch #diff #delta #binary #bspatch

bsdiff

Rust port of the bsdiff binary diffing algorithm

4 releases

0.1.6 Aug 8, 2021
0.1.5 Jul 31, 2021
0.1.3 Jun 24, 2017

#323 in Compression

Download history 203/week @ 2023-11-02 166/week @ 2023-11-09 216/week @ 2023-11-16 177/week @ 2023-11-23 252/week @ 2023-11-30 290/week @ 2023-12-07 246/week @ 2023-12-14 284/week @ 2023-12-21 136/week @ 2023-12-28 299/week @ 2024-01-04 215/week @ 2024-01-11 296/week @ 2024-01-18 229/week @ 2024-01-25 311/week @ 2024-02-01 437/week @ 2024-02-08 216/week @ 2024-02-15

1,232 downloads per month
Used in cargo-mextk

BSD-2-Clause

17KB
338 lines

bsdiff-rs

Build status Cargo Link

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


lib.rs:

Bsdiff is a method of diffing files. This crate has been ported from C code. The original code and more info can be found here.

It is usually a good idea to use bsdiff alongside a compression algorithm like bzip2.

Examples

use std::io::Cursor;

let one = vec![1, 2, 3, 4, 5];
let two = vec![1, 2, 4, 6];
let mut cursor = Cursor::new(Vec::new());

diff::diff(&one, &two, &mut cursor).unwrap();
cursor.set_position(0);

let mut patched = vec![0; two.len()];
patch::patch(&one, &mut cursor, &mut patched).unwrap();
assert_eq!(patched, two);

No runtime deps