Bodu.IO.Hashing 1.3.0

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

Bodu.IO.Hashing

API stability - Stable. The public API surface is committed: breaking changes are reserved for a major-version bump per SemVer, except a deliberate break that is recorded in the release notes and in the package's CompatibilitySuppressions.xml. See versioning and support.

Non-cryptographic hashing, checksums, and check-digit algorithms for .NET 8 and .NET 10. Hash algorithms derive from System.IO.Hashing.NonCryptographicHashAlgorithm, so they expose the standard Append / GetCurrentHash / GetHashAndReset streaming surface and slot into existing pipelines. This package covers data-integrity and identifier-validation use cases - not security. For keyed/cryptographic hashing use the sibling Bodu.Security.Cryptography package or the platform System.Security.Cryptography types.

Installation

dotnet add package Bodu.IO.Hashing

Targets net8.0 and net10.0.

Quick start

using Bodu.IO.Hashing.Checksums;
using Bodu.IO.Hashing.CheckDigits;

// CRC: one parametric engine, 112 catalogued standards.
var crc = new Crc(CrcStandard.CRC32_ISOHDLC);           // the ubiquitous zip/png CRC-32
byte[] digest = crc.ComputeHash("123456789"u8);          // one-shot over bytes

// Or stream it: the standard NonCryptographicHashAlgorithm surface.
crc.Append("1234"u8);
crc.Append("56789"u8);
byte[] same = crc.GetHashAndReset();                     // equals the one-shot digest

// Check digits: static Compute / IsValid per identifier scheme.
bool ok = Iban.IsValid("GB82WEST12345698765432");        // true (electronic format, no spaces)
char check = Luhn.Compute("7992739871");                 // '3' -> card number 79927398713
bool valid = Isbn13.IsValid("9780306406157");            // true

Crc implements IResumableHashAlgorithm, so a stored digest can be extended with more data without replaying the original input. See the guides for the full catalogue, streaming, and verification surfaces.

Checksums and non-cryptographic hashes

Family Algorithms Output (bits) Notes
Fletcher Fletcher16, Fletcher32, Fletcher64 16 / 32 / 64 Position-sensitive checksum
Adler Adler32, Adler32C, Adler64 32 / 64 RFC 1950 family
FNV Fnv132, Fnv164, Fnv1a32, Fnv1a64 32 / 64 Fowler-Noll-Vo
CityHash CityHash32, CityHash64, CityHash128 32 / 64 / 128 Google CityHash
MurmurHash3 MurmurHash3_32, MurmurHash3_128 32 / 128
Pearson Pearson (selectable PearsonTableType) 8 to 2048, in steps of 8
String hashes ApHash, Bernstein, BKDR, Elf64, JSHash, Pjw32, SDBM, SuperFastHash varies Classic table / multiplicative hashes

CRC

A single parametric Crc engine drives the full RevEng catalogue - 112 standards spanning widths from CRC-3 to CRC-64 (CRC-3, -4, -5, -6, -7, -8, -10…-17, -21, -24, -30, -31, -32, -40, -64). CrcStandard is the immutable parameter bundle (polynomial, init, reflect-in/out, final XOR); the catalogue is exposed through the CrcStandards enum, and CrcLookupTableCache shares lookup tables across instances with matching (width, polynomial, reflectIn). Crc implements IResumableHashAlgorithm, so a digest can be extended from a prior hash without replaying the original input.

Check digits

Streaming check-digit algorithms (Append(ReadOnlySpan<char>) → GetCurrentCheckDigit()) for identifier validation and generation:

Domain Algorithms
General Luhn, Damm, Verhoeff, Gumm, Iso7064Mod11_2, Iso7064Mod97_10
Banking AbaRoutingNumber, Iban
Retail / barcode Ean8, Ean13, Gtin14, UpcA, Code39Mod43
Securities Isin, Cusip, Sedol, Lei
Publishing Isbn10, Isbn13
Encoding Crockford32

Decimal algorithms derive from CheckDigitAlgorithm; alphanumeric and multi-character schemes derive from AlphanumericCheckDigitAlgorithm / MultiCharCheckDigitAlgorithm, with CheckDigitInputAlphabet / CheckDigitOutputAlphabet selecting the permitted character sets.

Streaming and one-shot APIs

The extension surface on NonCryptographicHashAlgorithm adds AppendData(Stream), one-shot ComputeHash(...) / ComputeHashAsync(Stream), and VerifyHash / TryVerifyHash (sync and async; the comparison is not constant-time) over the standard incremental Append / GetCurrentHash / Reset methods.

Runnable samples

The repository ships offline, dotnet run-able sample projects for this package - the CRC catalogue and checksum families, streaming and resumable digests, identifier check digits across domains, and a custom check-digit scheme proven by the shared contract-test base - under samples/IO.Hashing/.

Building and testing

To build this package from source and run its tests, see CONTRIBUTING.md. The published vectors and corpora the tests hold it to are listed under conformance and test vectors.

License

MIT. © Bodu Pty. Ltd.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
1.3.0 278 10/16/2026
1.0.0 1,231 9/24/2026
0.7.0 522 9/24/2026
0.6.0 121 9/24/2026
0.5.0 134 9/23/2026