sisong/HDiffPatch
Freea C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
About sisong/HDiffPatch
HDiffPatch is a C/C++ library and command-line tool for creating and applying binary diffs and patches between files or entire directories. It is cross-platform, runs fast, produces small deltas, and handles large files while limiting memory usage. The tool defines its own patch format but is also compatible with bsdiff4 and open-vcdiff (VCDIFF RFC 3284) formats. It includes specialized modules: HPatchLite for embedded systems (MCU, NB-IoT) with ultra-low RAM (1KB) support and inplace-patching; ApkDiffPatch for smaller Android APK patches (requires re-signing); sfpatcher for app-store-friendly APK patching; and hsynz for sync scenarios similar to zsync but faster with zstd compression. HDiffPatch treats files as byte streams and does not preserve file metadata like timestamps or permissions.
Key Features
Pros & Cons
- Open source and free to use
- Cross-platform (Windows, Linux, macOS, Android)
- Fast diff and patch operations
- Generates very small delta files
- Low memory usage, suitable for large files and constrained devices
- Compatible with other popular patch formats (bsdiff, VCDIFF)
- Includes specialized tools for Android and embedded systems
- Supports both file-level and directory-level patching
- Does not preserve file metadata (permissions, timestamps, symlinks, etc.)
- ApkDiffPatch requires re-signing APKs, limiting use in app stores
- No built-in text-aware diffing (pure binary approach)
- Documentation is primarily the README on GitHub, may lack extensive examples
- Learning curve for integrating the library into existing projects