1 unstable release

new 0.1.0 Jan 13, 2025

#537 in Cryptography

BSD-3-Clause

11KB
194 lines

dsum: directory checksum

Like md5sum(1) and shasum(1), but for directories. It calculates a sum list just like md5sum, then sums that as if the directory is a file with that as content.

For now, install with cargo install dsum.

Multiple hashing algorithms are supported. By default BLAKE3 is used, due to its speed.

For convenience, dsum(1) can be invoked as b2dsum, b3dsum, sha1dsum, etc. and directly use the named algorithm. cargo install does not support this kind of "installation", the install-aliases.sh script might be helpful.

Inspired by David Tolnay's sha1dir, which uses a clever trick of XORing checksums of each directory entry into one. However these checksums are calculated differently from traditional *sum(1)s, plus also hashing in file modes, which might not be desirable.

Dependencies

~3–11MB
~117K SLoC