pub async fn hash_directory_tree<D: Digest>(
dir: &Path,
hasher: &mut D,
) -> Result<()>Expand description
Compute a hash of a directory tree using the provided hasher.
This function traverses the directory tree deterministically (sorted by file name) and includes both file paths and file contents in the hash computation.
§Arguments
dir- The directory to hashhasher- A hasher implementing the Digest trait (e.g., Sha256::new())
§Returns
() - The hasher is updated with the directory tree data