Soenneker.Managers.HashChecking 11.0.904

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Managers.HashChecking --version 11.0.904
                    
NuGet\Install-Package Soenneker.Managers.HashChecking -Version 11.0.904
                    
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="11.0.904" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Managers.HashChecking" Version="11.0.904" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Managers.HashChecking" />
                    
Project file
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 11.0.904
                    
#r "nuget: Soenneker.Managers.HashChecking, 11.0.904"
                    
#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@11.0.904
                    
#: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=11.0.904
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Managers.HashChecking&version=11.0.904
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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: true with the newly calculated hash.
  • Stored leading/trailing whitespace is ignored during comparison.
  • hashFileName may be a relative path inside gitDirectory; 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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
11.0.910 3,224 11/3/2026
11.0.909 413 11/3/2026
11.0.908 572 11/3/2026
11.0.907 78 11/3/2026
11.0.906 1,866 11/2/2026
11.0.905 6,009 10/29/2026
11.0.904 4,887 10/27/2026
11.0.903 244 10/26/2026
11.0.902 170 10/26/2026
11.0.901 338 10/26/2026
11.0.900 215 10/26/2026
11.0.899 99 10/26/2026
11.0.898 94 10/26/2026
4.0.897 12,682 10/15/2026
4.0.896 96 10/14/2026
4.0.895 1,412 10/14/2026
4.0.892 1,851 10/14/2026
4.0.886 924 10/13/2026
4.0.884 109 10/12/2026
4.0.881 1,851 10/12/2026
Loading failed

Updated Soenneker.Hashing.Blake3 to 11.0.187