5 releases

0.2.0 May 19, 2023
0.1.3 Mar 26, 2023
0.1.2 Feb 7, 2023
0.1.1 Jan 28, 2022
0.1.0 Jan 27, 2022

#356 in Algorithms

Download history 1999/week @ 2024-01-03 3519/week @ 2024-01-10 3907/week @ 2024-01-17 3811/week @ 2024-01-24 3232/week @ 2024-01-31 4582/week @ 2024-02-07 4302/week @ 2024-02-14 4713/week @ 2024-02-21 3686/week @ 2024-02-28 4163/week @ 2024-03-06 4086/week @ 2024-03-13 5401/week @ 2024-03-20 4006/week @ 2024-03-27 4587/week @ 2024-04-03 5019/week @ 2024-04-10 3649/week @ 2024-04-17

17,944 downloads per month
Used in 50 crates (10 directly)

MIT license

120KB
2K SLoC

dmp

The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronising plain text. This repository contains a Rust version of the original diff-match-patch library, using up-to-date crate packages.

docs.rs Crates.io

Features

  • Diffing and patching library for plain text
  • Retrieve differences between two blocks of text
  • Create a set of patches for converting a block of text into another
  • Apply a set of patches onto a block of text to convert it to another block of text
  • Uses best-effort to apply patch even when the underlying text doesn't fully match.

Fuzzing

A fuzzer is provided as a sanity-check:

RUST_BACKTRACE=1 cargo fuzz run fuzz

Original

This code is forked originally from diff_match_patch.rs, licensed under the MIT license.

Dependencies