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 the stat, as returned by os.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.
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:
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.