DirectoryHashCalculator.

Calculate(DirectoryPath, IEnumerable<GlobPattern>, HashAlgorithm) Method

Summary

Calculates the hash for a given directory.
Namespace
Cake.Common.Security
Containing Type
DirectoryHashCalculator

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<GlobPattern> The glob pattern to match.
hashAlgorithm HashAlgorithm The hash algorithm to use.

Return Value

Type Description
DirectoryHash A DirectoryHash instance representing the calculated hash.