bcmp
bcmp
is a simple crate which offers data comparison mechanisms which go beyond the simple
equality. It only operates on byte slices, hence its name, and relies on efficiently finding
common substrings between two blob of data. The implementation relies on two different linear
time algorithms: a HashMap
based algorithm called HashMatch
and
a suffix tree built using Ukkonen algorithm called TreeMatch
.
Examples
Iterate over the matches between two strings using HashMatch
with a
minimum match length of 2 bytes:
extern crate bcmp;
use ;
Construct a patch set to build the file b
from the file a
using TreeMatch
with a minimum match length of 4 bytes:
extern crate bcmp;
use File;
use Read;
use ;