I've got two binary files. They look something like this, but the data is more random:
File A:
FF FF FF FF 00 00 00 00 FF FF 44 43 42 41 FF FF ...
File B:
41 42 43 44 00 00 00 00 44 43 42 41 40 39 38 37 ...
What I'd like is to call something like:
>>> someDiffLib.diff(file_a_data, file_b_data)
And receive something like:
[Match(pos=4, length=4)]
Indicating that in both files the bytes at position 4 are the same for 4 bytes. The sequence 44 43 42 41
would not match because they're not in the same positions in each file.
Is there a library that will do the diff for me? Or should I just write the loops to do the comparison?
get_matching_blocks()
doesn't check if the bytes are in the same spot in each files, just that the sequence exists in each file. Otherwise, yeah, that's pretty much what I want. – omghai2u Apr 3 '13 at 21:2844 43 42 41
to match because they're in different positions; if that's what you mean. – omghai2u Apr 3 '13 at 21:31