Summary
Calculates the hash for a given file.
- Namespace
- Cake
.Common .Security - Containing Type
- SecurityAliases
Syntax
[CakeMethodAlias]
public static FileHash CalculateFileHash(this ICakeContext context, FilePath filePath, HashAlgorithm hashAlgorithm)
Examples
Information(
"Cake executable file MD5 hash: {0}",
CalculateFileHash("Cake.exe", HashAlgorithm.MD5).ToHex());
Attributes
Type | Description |
---|---|
Cake |
An attribute used to mark script method aliases. |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
filePath | FilePath | The file path. |
hashAlgorithm | HashAlgorithm | The hash algorithm to use. |