Soenneker.Managers.HashChecking
4.0.822
Prefix Reserved
dotnet add package Soenneker.Managers.HashChecking --version 4.0.822
NuGet\Install-Package Soenneker.Managers.HashChecking -Version 4.0.822
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Managers.HashChecking" Version="4.0.822" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Managers.HashChecking" Version="4.0.822" />
<PackageReference Include="Soenneker.Managers.HashChecking" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Managers.HashChecking --version 4.0.822
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Managers.HashChecking, 4.0.822"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Managers.HashChecking@4.0.822
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Managers.HashChecking&version=4.0.822
#tool nuget:?package=Soenneker.Managers.HashChecking&version=4.0.822
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Managers.HashChecking
Compares BLAKE3 hashes for a file or directory against a hash stored in a repository checkout.
Install
dotnet add package Soenneker.Managers.HashChecking
Usage
using Microsoft.Extensions.DependencyInjection;
using Soenneker.Managers.HashChecking.Abstract;
using Soenneker.Managers.HashChecking.Registrars;
services.AddHashCheckingManagerAsSingleton();
IHashCheckingManager hashes =
serviceProvider.GetRequiredService<IHashCheckingManager>();
(bool needsUpdate, string newHash) = await hashes.CheckForHashDifferences(
gitDirectory: repositoryPath,
filePath: downloadedBinaryPath,
hashFileName: "hash.txt",
cancellationToken);
if (needsUpdate)
{
// Validate and publish the new artifact, then persist newHash.
}
The methods only compare hashes. They do not write the hash file or update Git.
What you get
IHashCheckingManager— Handles hashing and verification of binaries.HashCheckingManagerRegistrar— Handles hashing and verification of binaries.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
IHashCheckingManager.CheckForHashDifferences(gitDirectory, filePath, hashFileName, cancellationToken) |
Checks whether the specified file's hash differs from the stored hash in the given Git directory and determines if an update is required. | A value task that returns a tuple containing a boolean indicating whether an update is needed, and the new hash value if a difference is detected. |
IHashCheckingManager.CheckForHashDifferencesOfDirectory(gitDirectory, inputDirectory, hashFileName, cancellationToken) |
Compares the hash of the specified input directory with the hash stored in the given Git directory to determine if an update is required. | A tuple containing a Boolean value indicating whether the input directory needs to be updated (true if an update is required; otherwise, false), and a string representing the newly computed hash of the input directory. |
HashCheckingManagerRegistrar.AddHashCheckingManagerAsSingleton(services) |
Adds IHashCheckingManager as a singleton service. |
The same service collection, so additional registrations can be chained. |
HashCheckingManagerRegistrar.AddHashCheckingManagerAsScoped(services) |
Adds IHashCheckingManager as a scoped service. |
The same service collection, so additional registrations can be chained. |
Important behavior
- A missing or unreadable stored hash returns
needsUpdate: truewith the newly calculated hash. - Stored leading/trailing whitespace is ignored during comparison.
hashFileNamemay be a relative path insidegitDirectory; paths that escape the checkout are rejected.- Directory comparisons use
IBlake3Util.HashDirectoryToAggregateString. Use the returned aggregate string as the next stored value.
Practical notes
- Hashing large files or directories can be expensive; pass cancellation through from the owning runner.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Soenneker.Hashing.Blake3 (>= 4.0.113)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Managers.HashChecking:
| Package | Downloads |
|---|---|
|
Soenneker.Managers.Runners
Handles Runner operations and coordination |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.822 | 472 | 8/30/2026 |
| 4.0.821 | 31 | 8/30/2026 |
| 4.0.820 | 40 | 8/30/2026 |
| 4.0.819 | 2,849 | 8/29/2026 |
| 4.0.818 | 143 | 8/29/2026 |
| 4.0.817 | 33 | 8/29/2026 |
| 4.0.816 | 7,209 | 8/27/2026 |
| 4.0.815 | 3,850 | 8/22/2026 |
| 4.0.814 | 95 | 8/22/2026 |
| 4.0.813 | 402 | 8/22/2026 |
| 4.0.812 | 4,792 | 8/19/2026 |
| 4.0.811 | 1,296 | 8/18/2026 |
| 4.0.810 | 380 | 8/18/2026 |
| 4.0.809 | 5,410 | 8/13/2026 |
| 4.0.808 | 7,139 | 8/9/2026 |
| 4.0.807 | 3,157 | 8/8/2026 |
| 4.0.806 | 93 | 8/8/2026 |
| 4.0.805 | 1,705 | 8/8/2026 |
| 4.0.804 | 3,100 | 8/7/2026 |
| 4.0.803 | 6,711 | 7/30/2026 |
Loading failed
Update dependency Soenneker.Hashing.Blake3 to 4.0.113 (#1376)