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
<PackageReference Include="Soenneker.Utils.SHA3" Version="4.0.1527" />
<PackageVersion Include="Soenneker.Utils.SHA3" Version="4.0.1527" />
<PackageReference Include="Soenneker.Utils.SHA3" />
paket add Soenneker.Utils.SHA3 --version 4.0.1527
#r "nuget: Soenneker.Utils.SHA3, 4.0.1527"
#:package Soenneker.Utils.SHA3@4.0.1527
#addin nuget:?package=Soenneker.Utils.SHA3&version=4.0.1527
#tool nuget:?package=Soenneker.Utils.SHA3&version=4.0.1527
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 | 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. |
-
net10.0
- BouncyCastle.NetCore (>= 2.2.1)
- Soenneker.Extensions.Arrays.Bytes (>= 4.0.67)
- Soenneker.Utils.Directory (>= 4.0.939)
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 | 23 | 2026/9/13 |
| 4.0.1526 | 33 | 2026/9/13 |
| 4.0.1525 | 38 | 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 | 45 | 2026/9/8 |
| 4.0.1517 | 55 | 2026/9/8 |
| 4.0.1516 | 53 | 2026/9/8 |
| 4.0.1515 | 63 | 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 | 92 | 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 |
Updated NuGet packages
NuGet-Builder-Operation: a126ac68a8944093aa0b18f31119c445