7 releases

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

#69 in Compression

Download history 9/week @ 2021-06-06 7/week @ 2021-06-13 5/week @ 2021-06-20 4/week @ 2021-06-27 5/week @ 2021-07-04 6/week @ 2021-07-11 22/week @ 2021-07-18 31/week @ 2021-07-25 46/week @ 2021-08-01 28/week @ 2021-08-08 54/week @ 2021-08-15 10/week @ 2021-08-22 3/week @ 2021-08-29 6/week @ 2021-09-05 4/week @ 2021-09-12 6/week @ 2021-09-19

67 downloads per month
Used in cargo-mextk

BSD-2-Clause

16KB
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;
# use bsdiff::{patch, diff};

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