Soenneker.Utils.SHA3 11.0.1581

Prefix Reserved
dotnet add package Soenneker.Utils.SHA3 --version 11.0.1581
                    
NuGet\Install-Package Soenneker.Utils.SHA3 -Version 11.0.1581
                    
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.Utils.SHA3" Version="11.0.1581" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.SHA3" Version="11.0.1581" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.SHA3" />
                    
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.Utils.SHA3 --version 11.0.1581
                    
#r "nuget: Soenneker.Utils.SHA3, 11.0.1581"
                    
#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.Utils.SHA3@11.0.1581
                    
#: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.Utils.SHA3&version=11.0.1581
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.SHA3&version=11.0.1581
                    
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

alternate text is missing from this package README image Soenneker.Utils.SHA3

Computes SHA3-256 digests for UTF-8 strings, files, and framed directory trees.

Installation

dotnet add package Soenneker.Utils.SHA3

Registration

using Soenneker.Utils.SHA3.Registrars;

services.AddSha3UtilAsSingleton();

Scoped registration is also available. The utility keeps no per-operation hash state, so a singleton can safely serve concurrent callers.

Hash a string or file

string textDigest = sha3Util.HashString("example input");

string fileDigest = await sha3Util.HashFile(
    filePath,
    cancellationToken: cancellationToken);

Strings are encoded as UTF-8. Files are streamed rather than loaded completely into memory. Both methods return a 64-character uppercase hexadecimal SHA3-256 digest with no prefix or separators. Missing/inaccessible files and I/O failures propagate; file hashing observes cancellation.

The implementation uses the platform System.Security.Cryptography SHA3-256 implementation when available and falls back to BouncyCastle otherwise. The digest is the same algorithm and format on both paths; platform support does not by itself guarantee hardware acceleration.

Hash a directory tree

string treeDigest = await sha3Util.HashDirectory(
    directoryPath,
    cancellationToken: cancellationToken);

Directory hashing recursively enumerates files, orders their paths ordinally, and combines each file's relative path with its SHA3-256 content digest. Directory separators in relative paths are normalized to /. Each UTF-8 path is framed with a four-byte little-endian byte length before the fixed-size file digest, so record boundaries are unambiguous. An empty directory returns the SHA3-256 digest of empty input, not an empty string.

The directory operation is not a filesystem snapshot. Concurrent renames, writes, additions, or deletions can change the result or cause an exception. Metadata such as timestamps, permissions, empty subdirectories, and the root directory's own name are not included.

Directory digest framing changed from the earlier unframed concatenation format; existing stored directory hashes must be regenerated. String and file digest formats did not change.

Security scope

SHA3-256 is an unkeyed digest. It can detect changes when compared with a trusted expected value, but an attacker who can replace both content and digest can recompute it. Use HMAC or a digital signature for authenticity, and a password-hashing function with salt and work factor for passwords. Avoid logging sensitive input even though only operational details are logged here.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1581 102 11/11/2026
11.0.1580 55 11/11/2026
11.0.1579 52 11/11/2026
11.0.1578 52 11/11/2026
11.0.1577 56 11/11/2026
11.0.1576 68 11/11/2026
11.0.1575 70 11/11/2026
11.0.1574 55 11/11/2026
11.0.1573 353 11/3/2026
11.0.1572 97 11/3/2026
11.0.1571 101 11/3/2026
11.0.1570 159 10/27/2026
11.0.1569 96 10/26/2026
11.0.1568 92 10/26/2026
11.0.1567 100 10/26/2026
11.0.1566 92 10/26/2026
11.0.1565 90 10/26/2026
11.0.1564 98 10/26/2026
4.0.1563 116 10/15/2026
4.0.1562 107 10/15/2026
Loading failed

Updated Multiple NuGet packages