Function diff

Source
pub fn diff(
    before: &[u8],
    after: &[u8],
    diff_algorithm: DiffAlgorithm,
    compress_algorithm: CompressAlgorithm,
) -> Result<Patch, Error>
Expand description

Generates a patch between two byte slices using specified algorithms.

Creates a patch that can transform the before data into the after data, using the specified diff and compression algorithms.

ยงExample

use files_diff::{diff, DiffAlgorithm, CompressAlgorithm};

let before = b"original data";
let after = b"modified data";

let patch = diff(
    before,
    after,
    DiffAlgorithm::Rsync020,
    CompressAlgorithm::Zstd
)?;