checksumdir
checksumdir copied to clipboard
Add option to use stat instead of file bytes.
Calculating the hash of a directory using bytes can get expensive quickly, especially when working with large media files (e.g., videos). This commit adds an option to choose which data source is used to get bytes to be added to the hash, one of:
- 'deep' (default): read all the bytes in the file into the hash.
- 'shallow': do a
stat
on the file and use the filename and all values from thestat
, as returned byos.stat
.
@cakepietoast I'd be happy to make any changes to this that you deem appropriate, please let me know. Feel free to close this request if the change is unwanted.