Library
Module
Module type
Parameter
Class
Class type
Rabin's fingerprint and diff algorithm.
Let's take a random buffer a
. We can produce from it an index which is a (lightweight) simple table of occurences (string
) found into a
.
From this index, we can get a diff with another random buffer b
such as:
let index = make a in
let diff = delta index ~source:a ~target:b in
assert (apply a diff = b)
A diff is a list of hunk
. apply
is a simple function which needs the source a
to reconstruct b
.
delta index ~source ~target
returns a compression list between the Rabin's fingerprint of a source
index
with the target target
.
Note: the given source
must be the same (not necessary physically) than the source used to produce index
with make
.