[rb-general] Comparing binary files

David A. Wheeler dwheeler at dwheeler.com
Sun Nov 18 19:09:01 CET 2018


On November 18, 2018 12:29:39 PM EST, Gerardo Ballabio <gerardo.ballabio at gmail.com> wrote:
>Richard Parkins wrote:
>> Most binary file comparators just compare bytes, which doesn't detect
>deletions or insertions.

My personal workaround is to generate 1 byte in hexadecimal on each line, and then use regular diff -u.  Diff is quite good at detecting insertions and deletions. This approach is a total failure if there are internal pointers, since slight differences in length can produce a vast number of differences. But in some cases it works well enough, and it is super simple to do.


--- David A.Wheeler


More information about the rb-general mailing list