Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A binary differencing algorithm.
C++ Python C
tree: ba770e1be9

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
makefiles/vs90
src
test
.gitignore
README
setup.py
version.py

README

Author: John Whitney (jjw@deltup.org)
License: Mozilla Public License, v. 2.0.


Introduction
============

BDelta is a sophisticated sequence matching library bundled with a delta
creator and patch tool. This code is being used in production systems. Recent
releases should be stable, fast, and accurate.


Limitations / Warranty
======================

Note that there is currently a 4GB file size limitation.

This software does not come with any guarantees. However, if you have any
problems, please send me an e-mail and I'll likely be able to help. I would
especially like to know about any bugs that you find.


Library API C / C++
===================

BDelta can be used in a wide range of applications. It is easy for the library
user to optimize its behavior to obtain better performance and results.

The only header you need to include to use the library is "bdelta.h".

The key thing to know about BDelta's algorithm is that it is designed to
pass over the data multiple times, finding ever-smaller matches. The API
is designed to give a great deal of control over each pass. This functionality
is not well-documented, so contact me if you need help. I hope to add more
comments to the code in future releases.


Other Bindings
==============

A simple interface for accessing the API with Python is included. This
interface is kept up-to-date since I do a lot of work in Python these days. To
istall it, just type "python build.py install" in the root folder. You'll need 
Cython to build/install, but Cython is not required after installation.

See test/py_bindings.py for a usage example.


Delta File Format
=================

The included delta creator / patch tool uses this simple binary format:

(All numbers are stored in little-endian format)
char[3] magic "BDT"
uint16 version (1, but will increment if this binary format changes)
uint8 integer size (size, in bytes, of <uintXX> and <intXX> fields.)
<uintXX> file 1 size
<uintXX> file 2 size
<uintXX> number of matches
for each match {
	<intXX> location in file 1 (relative to last match)
	<intXX> location in file 2 (relative to last match)
	<uintXX> match size
}
<Any data which is not matched is appended here, at the end of the patch>
Something went wrong with that request. Please try again.