4 releases

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

#184 in Compression

Download history 23/week @ 2022-10-10 32/week @ 2022-10-17 28/week @ 2022-10-24 23/week @ 2022-10-31 51/week @ 2022-11-07 45/week @ 2022-11-14 43/week @ 2022-11-21 23/week @ 2022-11-28 29/week @ 2022-12-05 30/week @ 2022-12-12 16/week @ 2022-12-19 26/week @ 2022-12-26 30/week @ 2023-01-02 19/week @ 2023-01-09 13/week @ 2023-01-16 23/week @ 2023-01-23

86 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;
# 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