4

I'm trying to use bsdiff (or any binary diff implementation you come up with) to compute and apply diff onto random binary data. I would like to use it on data from a database, so it would be better not to have to write those onto disk and pass them to bsdiff.exe.

Is there any wrapper library or way in python to do that?

2

3 Answers 3

5

From the bsdiff website:

It has also been made into a Python extension module, and there is a Windows port available.

Following the link brings you to the module's page.

Sign up to request clarification or add additional context in comments.

3 Comments

I somehow saw the Windows link but not this one... There's no version for 2.6 but it can't be that hard to build for it, am I right?
Probably isn't hard. Definitely worth trying.
python setup.py install just does'nt work, gives me "failed with exit status 1107".
2

You can use difflib that is part of Python standard library. You can send any arbitrary data into a difflib.SequenceMatcher.

3 Comments

difflib seems to be made for text files, returning the diff between the lines.
not true. You can send any arbitrary data into a SequenceMatcher.
difflib is horrifically slow for largeish (~4MB) blocks of bytes.
1

Also, the SequenceMatcher class (from the Python standard library) can be helpful.

Check out the other contents of the difflib module as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.