hristogochev / merkle_hash

Finds the hashes of all files and directories in a directory tree
https://crates.io/crates/merkle_hash
MIT License
15 stars 2 forks source link

Support for Glob Patterns? #22

Open david-mk-lawrence opened 4 months ago

david-mk-lawrence commented 4 months ago

Hello 👋 , this is a great library!

I would like to use this library to compute file and directory hashes for a very large directory, but the directory might contain files that I'm not interested in computing hashes for.

Would it be possible for this library to support a glob so that I can filter by the file extensions (or sub-directories) I'm interested in?

hristogochev commented 4 months ago

Hello 👋 Thanks for the suggestion, a file name and extension filter is definitely possible. It just hasn't crossed my mind yet. I will look into it when I have the time!

hristogochev commented 4 months ago

I would like to point out that the way the library currently computes hashes for directories is that it relies on the order of ALL files inside. Excluding even a single file or sub-directory hash would result in a different hash for the directory.