I am working on a small tool to allow receiving big (GByte sized) files over the Internet or though slow links in general in less time and with less data transfer, provided you already have a previous version of that big file, of course.
It is like something in between rsync and zsync:
The project is at github:
Right now I am just implementing a naive difference detection algorithm:
The file is sliced in blocks of some size (1MiB by default) and only the blocks that match in-place in both sides are used from the local file.
This seems quite fast, (when both the server and client side bulk hash dumps are pregenerated), but does not cover shifting and shuffling changes that might happen as well sometimes.
To cover those cases rsync/zsync use a rolling checksum of a block size that can be calculated at any point (scrolling) just by adding the new byte to the checksum and "deleting/removing" the first from it.
I was pointed to rsync's author docs on rsync design:
And I now have a few go related questions...
Is go's hash/adler32 checksum a rolling hash I can use for this?
If so... How can I roll a byte from the end?
(Any code sample available?)
If not, is there already go implementation of a rolling checksum I could use for my tool?
(That would save me quite some time)
Any more help and guidance on this topic is well come.