Merkle trees are pretty interesting.
-
Merkle trees are pretty interesting.
-
@jalcine Merkle trees are fun
Librecast's lcsync multicast file syncing tool is based on merkle trees.
Divide a file into blocks. Hash each block (using BLAKE3, which is itself a merkle tree internally), then hash each pair of hashes in each row and repeat until you get to a single tree hash, which is the file hash.
Compare the hashes starting at the root quickly to find differences in files, then request just the blocks you need by JOINing the multicast group(s) corresponding to the hash.
-
@jalcine Leaving out the network and just syncing two files on the same machine the merkle tree sync beats rsync's hashing comparisons every time.
Copyright © 2024 NodeBB | Contributors