Hashsync
Hashsync is a tool that runs a command over SSH and deduplicates the command's output, input, or both against an index of the receiving host's files. It searches every byte offset of the stream for blocks of indexed files and works as a transparent pipe compatible with rsync, tar, or anything else sent through SSH, relying on 256-bit cryptographically-strong hashes (Blake3 or optionally SHA-256) for correctness.
What it addresses
rsync's delta transfer only compares each file with the same-named file on the destination, so renamed, moved, and copied files are sent in full, and nix-copy-closure resends entire rebuilt packages, wasting bandwidth on slow connections.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
Hashsync
Hashsync is a tool that runs a command over SSH and deduplicates the command's output, input, or both against an index of the receiving host's files. It searches every byte offset of the stream for blocks of indexed files and works as a transparent pipe compatible with rsync, tar, or anything else sent through SSH, relying on 256-bit cryptographically-strong hashes (Blake3 or optionally SHA-256) for correctness.
Problem: rsync's delta transfer only compares each file with the same-named file on the destination, so renamed, moved, and copied files are sent in full, and nix-copy-closure resends entire rebuilt packages, wasting bandwidth on slow connections.
Posted by @someplaceguy · Original source ↗
Story title · @someplaceguy · · Source ↗
Show HN: Hashsync – Deduplicate SSH streams against the receiver's files
Submitted URL · @someplaceguy · · Source ↗
https://github.com/someplaceguy/hashsync
Source text · @someplaceguy · · Source ↗
So I created hashsync, which runs a command over SSH and deduplicates the command's output, input, or both against an index of the receiving host's files.
Source text · @someplaceguy · · Source ↗
It searches at every byte offset of the stream, whatever its format, for blocks of the indexed files.
Source text · @someplaceguy · · Source ↗
It's a transparent pipe, so it works with rsync, tar, or anything else you'd send through ssh.
Source text · @someplaceguy · · Source ↗
rsync's delta transfer compares each file only with the file of the same name on the destination (or, with --fuzzy, a file in the same directory), so renamed, moved and copied files are sent in full.
Source text · @someplaceguy · · Source ↗
nix-copy-closure can be worse: a rebuilt package gets a new store path, so the whole package is sent again, even when most of its contents haven't changed.
Source text · @someplaceguy · · Source ↗
correctness does rely on the block hashes, which would only be a problem if there was a hash collision, which is practically impossible given that hashsync uses 256-bit cryptographically-strong hashes (Blake3 or optionally, SHA-256).