DEV Community

Ozan Civaner
Ozan Civaner

Posted on

hashdir: Summarizing Directories in a Cross-Platform Way

This is a submission for the GitHub Finish-Up-A-Thon Challenge

What I Built

Some time ago, I needed to calculate hashes of directory trees across multiple platforms and architectures. Many existing solutions were based on GNU find, but I quickly realized that this approach has a number of shortcomings.

As a result, hashdir was born: a cross-platform tool that takes into account many of the quirks and edge cases involved in calculating directory hashes, including character encoding, path separators, path overlaps, symlinks, and more. For use cases involving directory structures that contain very large binary files, I also added support for the imohash algorithm, which can hash large files quickly while maintaining an acceptable error rate.

Once it had solved my original problem, I decided to share it with the world.

Demo

A short demo, along with installation and usage instructions can be found in the repository.

The Comeback Story

To my pleasant surprise, people began engaging with hashdir in various ways. One user reached out to tell me they were using it in their work and requested additional features, while another packaged it for their own use. Their interest motivated me to expand the feature set, improve test coverage and continuous integration, and further strengthen the codebase's robustness and overall quality.

Top comments (0)