# \[ANN\] Duff 0.1 - a diff library

**URL:** <https://discuss.ocaml.org/t/ann-duff-0-1-a-diff-library/1887>\
**Category:** Community\
**Tags:** git, compression, diff\
**Created:** [April 20, 2018, 7:28pm UTC](https://discuss.ocaml.org/t/ann-duff-0-1-a-diff-library/1887 "2018-04-20T19:28:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinosaure](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dinosaure/32/16_2.png) [@dinosaure](https://discuss.ocaml.org/u/dinosaure)\
**Post date:** [April 20, 2018, 7:28pm UTC](https://discuss.ocaml.org/t/ann-duff-0-1-a-diff-library/1887/1 "2018-04-20T19:28:44Z")

</div>

I’m happy yo announce [`duff`](https://github.com/dinosaure/duff) is now available on OPAM.

This package is an implementation of [`libXdiff`](http://www.xmailserver.org/xdiff-lib.html) in OCaml tuned for [`ocaml-git`](https://github.com/mirage/ocaml-git). This library can produce a _hash-table_ from a source and produce an unreadable diff with a _target_.

Then, we have a tight representation of your _target_ which can be reconstructed (patch) with your source. This package provides a little binary `duff` which do this transformation as an example:

```auto
$ ./duff.exe diff source target > target.xduff
$ ./duff.exe patch source < target.xduff > target.new
$ diff target target.new
$ echo $?
0

```

Of course, as a part of MirageOS project (and specially a part of ocaml-git), this package does not need an unix environment. Finally, this package is obviously close to ocaml-git and respects some restrictions explained in the [README.md](https://github.com/dinosaure/duff/blob/master/README.md). As [others extracted parts of ocaml-git](https://github.com/dinosaure/encore), this library needs improvements about API, so feel free to participate.

Good patch!
