sisong / HDiffPatch

a 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.
Other
1.52k stars 280 forks source link

A "CreateSignature" for diff tool would be nice #378

Closed WindowsNT closed 4 months ago

WindowsNT commented 6 months ago

I am considering using this for live updates of my apps. Currently I use Microsoft's RDC implementation.

It would be nice if there was a signature tool so the signatures are kept offline. For example:

Old folder = in web New folder = in my PC.

I could generate a signature for the old folder for the diff tool to use it instead of having to download again the old folder from my site in order to compare it with the newer folder in my PC.Therefore, a diff can be created without the original source to be present, only it's signature.

MSRDC supports that but of course, only Windows.

Best.

sisong commented 6 months ago

a diff can be created without the original source to be present, only it's signature.

hdiffpatch lib have a demo hsynz, only used new data's hash datas(signature), to create any old datas's diff file.

Is it possible to meet your needs?

WindowsNT commented 6 months ago

Basically, the idea is this:

  1. I have a folder in my local system which is duplicated in a remote system. All the file "signatures" are precalculated.
  2. When I want to push an update, I update my local folder.
  3. At this point I want to generate a diff file for the remote system without the need to compare the new local updated folder with the old folder (which resides in the remote system), but instead do that based on the precalculated signatures which are smaller and can be downloaded from the remote system.

So it would be the same as hdiffz/hpatchz but hdiffz would only create the diff from the precalculated signature file, not from the entire remote directory (which is very large).

So I will take a look to hsynz and see if it works, thanks a lot for your support.