in reply to File Diff'ing
Depending on the exact nature of the problem, even Digest::MD5
might be overkill.
If your probelm is just to compare an old file to a new file
once to see if they differ, then MD5 is unnecessary. Simply
compare their sizes. If they differ, you are done. If they
are the same, open the two files and compare line by line,
breaking out of the loop at the first difference. Easy and
faster than hashing both files first.
If your problem is to compare a new file against many old
files (to reject duplicates) or to compare many new files to
an old file (sample and do something when a file is updated) then
hashing to an MD5 signature is the fastest approach. Although
it depends on differing files generating differing signatures,
the chance of a collision is, welll, you should live so long :)
-Mark