Soenneker.Managers.HashChecking 11.0.918

Prefix Reserved
dotnet add package Soenneker.Managers.HashChecking --version 11.0.918
                    
NuGet\Install-Package Soenneker.Managers.HashChecking -Version 11.0.918
                    
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.918" />
                    
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.918" />
                    
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.918
                    
#r "nuget: Soenneker.Managers.HashChecking, 11.0.918"
                    
#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.918
                    
#: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.918
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Managers.HashChecking&version=11.0.918
                    
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.918 2,390 11/11/2026
11.0.917 612 11/11/2026
11.0.916 293 11/11/2026
11.0.915 194 11/11/2026
11.0.914 1,039 11/11/2026
11.0.913 79 11/11/2026
11.0.912 84 11/11/2026
11.0.910 9,179 11/3/2026
11.0.909 427 11/3/2026
11.0.908 590 11/3/2026
11.0.907 90 11/3/2026
11.0.906 1,877 11/2/2026
11.0.905 6,023 10/29/2026
11.0.904 4,890 10/27/2026
11.0.903 247 10/26/2026
11.0.902 173 10/26/2026
11.0.901 344 10/26/2026
11.0.900 220 10/26/2026
11.0.899 101 10/26/2026
11.0.898 98 10/26/2026
Loading failed

Update dependency Soenneker.Hashing.Blake3 to 11.0.201 (#1520)