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

#445 in Text editors

Download history 4020/week @ 2024-08-01 5178/week @ 2024-08-08 4716/week @ 2024-08-15 4723/week @ 2024-08-22 4398/week @ 2024-08-29 4577/week @ 2024-09-05 4611/week @ 2024-09-12 4424/week @ 2024-09-19 4034/week @ 2024-09-26 4367/week @ 2024-10-03 3246/week @ 2024-10-10 4647/week @ 2024-10-17 4195/week @ 2024-10-24 3749/week @ 2024-10-31 4245/week @ 2024-11-07 5460/week @ 2024-11-14

18,472 downloads per month
Used in 74 crates (12 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