Method CalculateChecksumAsync
Namespace: Belay.Sync
Assembly: Belay.Sync.dll
CalculateChecksumAsync(string, string, CancellationToken)
Calculates a checksum for the specified file.
csharp
public Task<string> CalculateChecksumAsync(string path, string algorithm = "md5", CancellationToken cancellationToken = default)
Parameters
path
string
The file path to calculate checksum for.
algorithm
string
The checksum algorithm to use (e.g., "md5", "sha256").
cancellationToken
CancellationToken
Cancellation token to cancel the operation.
Returns
The hexadecimal checksum string.
Exceptions
Thrown when the file does not exist.
Thrown when the algorithm is not supported.