Hasher
Over the years I ran into the same issue again and again, that I found some old files on a hard drive or a directory with files somewhere on a machine and I didn’t remember its purpose or the state it was in.
For source code git solves this problem in a neat fashion, but you wouldn’t typically commit binaries, PSD, large amounts of JPEGs, RAW images or even Video files. I had always longed for a quick and easy way to check the difference between two folders.
Last month on a long train ride I tried whether AI could help me solve this with shell scripts and readily available UNIX tools1. And the initial version did work, but was awfully slow (we’re talking dozens of minutes). And since I wanted to dabble in Rust for quite a while now but have never gotten around to it, I tried vibe coding the thing with Claude.
Claude came back with 3 simple files2 that compiled and run without error and now run the same thing that took 20 minutes earlier with the shell script in 34 seconds! This definitely goes into my $HOME/bin dir.
I cleaned it up and put it on GitHub. As of now I consider it feature complete, and I have successfully tested it on Linux and macOS.
Considerations
The program uses SHA256 because that is safe and future-proof enough, available just about everywhere and in most cases even hardware-accelerated.
When hashing a directory, it will create a sorted listing of its contents, where each of the entries contains its type, name and hash. This makes this safe and comparable.
To drill into directories further the -v command can be used to show the hashes of the entries.