DIFFBYTS

Name

diffbyts -- takes two binary data files and compares them byte for byte, compiling a cumulative histogram of differences.

Synopsis

diffbyts <file1><file2>

DESCRIPTION

Diffbyts takes as input two binary files of equal length and compares the contents between the two files byte for byte. The differences between corresponding pairs of bytes are accumulated into a histogram, where each bin in the histogram represents the integer difference between the byte pairs. Therefore, the first bin in the histogram contains the count of all those byte pairs that are exactly the same (a difference of 0); the next bin contains the count of all those byte pairs that are different by exactly 1; and so on.

Upon completion, this utility prints a formatted report of the accumulated histogram to standard output. Each difference bin in the histogram is listed on separate line in the report and formatted at follows:

d[b] = c : p where

b

is the current bin's byte pair difference.

c

is the number of corresponding byte pairs with difference equal to b.

p

is the cumulative percentage of corresponding pairs of bytes counted in all the bins up to and including the current bin.

OPTIONS

<file1>

a binary file to be compared byte for byte to file2.

<file2>

a binary file to be compared byte for byte to file1.

EXAMPLES

From test/imgtools/execs/diffbyts/diffbyts.src:

% diffbyts ../../data/finger/gray/raw/finger.raw ../dwsq/finger.raw > finger.hst compiles and stores a byte-difference histogram reporting the amount of image degradation due to lossy WSQ compression.

AUTHOR

NIST/ITL/DIV894/Image Group