Soenneker.Utils.SHA3 4.0.1527

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

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
4.0.1527 32 2026/9/13
4.0.1526 36 2026/9/13
4.0.1525 40 2026/9/13
4.0.1524 41 2026/9/13
4.0.1523 46 2026/9/12
4.0.1522 44 2026/9/12
4.0.1520 51 2026/9/9
4.0.1519 45 2026/9/9
4.0.1518 46 2026/9/8
4.0.1517 55 2026/9/8
4.0.1516 53 2026/9/8
4.0.1515 64 2026/9/7
4.0.1514 68 2026/9/7
4.0.1513 80 2026/9/7
4.0.1512 98 2026/9/5
4.0.1511 94 2026/9/4
4.0.1510 91 2026/9/4
4.0.1509 87 2026/9/4
4.0.1508 92 2026/9/4
4.0.1507 90 2026/9/4
Loading failed

Updated NuGet packages

NuGet-Builder-Operation: a126ac68a8944093aa0b18f31119c445