phrac

svndiff / deltav algorithm

The article at http://svn.collab.net/repos/svn/trunk/notes/svndiff explains how the svndiff algorithm works. This post tries to give a more concrete idea of what happens, refering to the example that can be found at the end of the above linked article.

SVN delivers the text deltas base64 encoded, so you first have to decode the string to work with it. Next step ist to check the string for it’s first four bytes, which must represent the following four characters: ‘S’, ‘V’, ‘N’, followed by the byte that indicates the format’s version number (for example, the SVN servers over at tigris.org use still Version 0, so the last byte would represent a 0 in this case)…