Summary
Calculates the hash for a given directory.
- Namespace
- Cake
.Common .Security - Containing Type
- Directory
Hash Calculator
Syntax
public DirectoryHash Calculate(DirectoryPath directoryPath, IEnumerable<GlobPattern> pattern, HashAlgorithm hashAlgorithm)
Examples
Information(
"Cake It calculates the hashes from all cs files in all subdirectories using a MD5 hash: {0}",
CalculateDirectoryHash("C:\directoryToHash", "./**/*.cs", HashAlgorithm.MD5).ToHex());
Parameters
Name | Type | Description |
---|---|---|
directoryPath | DirectoryPath | The directory path. |
pattern | IEnumerable |
The glob pattern to match. |
hashAlgorithm | HashAlgorithm | The hash algorithm to use. |
Return Value
Type | Description |
---|---|
DirectoryHash | A DirectoryHash instance representing the calculated hash. |