System.IO.Hashing 9.0.22

About

System.IO.Hashing offers a variety of hash code algorithms.

Hash code algorithms are pivotal for generating unique values for objects based on their content, facilitating object comparisons, and detecting content alterations. The namespace encompasses algorithms like CRC-32, CRC-64, xxHash3, xxHash32, xxHash64, and xxHash128, all engineered for swift and efficient hash code generation, with xxHash being an "Extremely fast hash algorithm".

Warning: The hash functions provided by System.IO.Hashing are not suitable for security purposes such as handling passwords or verifying untrusted content. For such security-critical applications, consider using cryptographic hash functions provided by the System.Security.Cryptography namespace.

Key Features

  • Variety of hash code algorithms including CRC-32, CRC-64, xxHash3, xxHash32, xxHash64, and xxHash128.
  • Implementations of CRC-32 and CRC-64 algorithms, as used in IEEE 802.3, and described in ECMA-182, Annex B respectively.
  • Implementations of XxHash32 for generating 32-bit hashes, XxHash3 and XxHash64 for generating 64-bit hashes, and xxHash128 for generating 128-bit hashes.

How to Use

Creating hash codes is straightforward. Call the Hash method with the content to be hashed.

Here is a practical example:

using System;
using System.IO.Hashing;

byte[] data = new byte[] { 1, 2, 3, 4 };

byte[] crc32Value = Crc32.Hash(data);
Console.WriteLine($"CRC-32 Hash: {BitConverter.ToString(crc32Value)}");
// CRC-32 Hash: CD-FB-3C-B6

byte[] crc64Value = Crc64.Hash(data);
Console.WriteLine($"CRC-64 Hash: {BitConverter.ToString(crc64Value)}");
// CRC-64 Hash: 58-8D-5A-D4-2A-70-1D-B2

byte[] xxHash3Value = XxHash3.Hash(data);
Console.WriteLine($"XxHash3 Hash: {BitConverter.ToString(xxHash3Value)}");
// XxHash3 Hash: 98-8B-7B-90-33-AC-46-22

byte[] xxHash32Value = XxHash32.Hash(data);
Console.WriteLine($"XxHash32 Hash: {BitConverter.ToString(xxHash32Value)}");
// XxHash32 Hash: FE-96-D1-9C

byte[] xxHash64Value = XxHash64.Hash(data);
Console.WriteLine($"XxHash64 Hash: {BitConverter.ToString(xxHash64Value)}");
// XxHash64 Hash: 54-26-20-E3-A2-A9-2E-D1

byte[] xxHash128Value = XxHash128.Hash(data);
Console.WriteLine($"XxHash128 Hash: {BitConverter.ToString(xxHash128Value)}");
// XxHash128 Hash: 49-A0-48-99-59-7A-35-67-53-76-53-A0-D9-95-5B-86

Main Types

The main types provided by this library are:

  • System.IO.Hashing.Crc32
  • System.IO.Hashing.Crc64
  • System.IO.Hashing.XxHash3
  • System.IO.Hashing.XxHash32
  • System.IO.Hashing.XxHash64
  • System.IO.Hashing.XxHash128

Additional Documentation

Cryptographic services, including secure encryption and decryption of data: System.Security.Cryptography

Feedback & Contributing

System.IO.Hashing is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.IO.Hashing.

Packages Downloads
Yarp.ReverseProxy
Reverse proxy toolkit for building fast proxy servers in .NET using the infrastructure from ASP.NET and .NET
687
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
104
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
68
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
61
Aspire.Hosting.MongoDB
MongoDB support for Aspire.
59
Azure.Storage.Common
This client library enables working with the Microsoft Azure Storage services which include the blob and file services for storing binary and text data, and the queue service for storing messages that may be accessed by a client. For this release see notes - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/README.md and https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/CHANGELOG.md in addition to the breaking changes https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Common/BreakingChanges.txt Microsoft Azure Storage quickstarts and tutorials - https://docs.microsoft.com/en-us/azure/storage/ Microsoft Azure Storage REST API Reference - https://docs.microsoft.com/en-us/rest/api/storageservices/
59
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
56
Minio
MinIO .NET SDK for Amazon S3 Compatible Cloud Storage.
55
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
55
Microsoft.SourceLink.GitHub
Generates source link for GitHub repositories.
54
Aspire.Hosting
Core abstractions for the Aspire application model.
53
Aspire.Hosting.Nats
NATS support for .NET Aspire.
53
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
53
Aspire.Hosting.PostgreSQL
PostgreSQL® support for Aspire.
53
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
52
Aspire.Hosting
Core abstractions for the Aspire application model.
52
Aspire.Hosting.PostgreSQL
PostgreSQL® support for Aspire.
52
Aspire.Hosting.PostgreSQL
PostgreSQL® support for .NET Aspire.
51

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-rc.3.26522.148 11 10/25/2026
11.0.0-rc.2.26504.105 14 10/13/2026
11.0.0-rc.1.26425.128 25 09/11/2026
11.0.0-preview.7.26381.103 23 08/13/2026
11.0.0-preview.6.26359.118 33 07/15/2026
11.0.0-preview.5.26302.115 32 06/13/2026
11.0.0-preview.4.26230.115 40 05/13/2026
11.0.0-preview.3.26207.106 47 04/15/2026
11.0.0-preview.2.26159.112 58 03/14/2026
11.0.0-preview.1.26104.118 58 02/11/2026
10.0.14 7 10/25/2026
10.0.13 13 10/13/2026
10.0.12 18 09/11/2026
10.0.11 25 08/13/2026
10.0.10 28 07/15/2026
10.0.9 32 06/10/2026
10.0.8 36 05/13/2026
10.0.7 2,074 04/21/2026
10.0.6 57 04/16/2026
10.0.5 157 03/14/2026
10.0.4 51 03/14/2026
10.0.3 62 02/11/2026
10.0.2 61 01/14/2026
10.0.1 61 12/11/2025
10.0.0 67 12/11/2025
10.0.0-rc.2.25502.107 63 12/12/2025
10.0.0-rc.1.25451.107 11 09/28/2026
10.0.0-preview.7.25380.108 57 12/15/2025
10.0.0-preview.6.25358.103 59 12/11/2025
10.0.0-preview.5.25277.114 62 12/11/2025
10.0.0-preview.4.25258.110 55 12/13/2025
10.0.0-preview.3.25171.5 56 12/13/2025
10.0.0-preview.2.25163.2 14 10/08/2026
10.0.0-preview.1.25080.5 51 12/13/2025
9.0.22 10 10/25/2026
9.0.21 10 10/13/2026
9.0.20 18 09/11/2026
9.0.19 31 08/13/2026
9.0.18 25 07/15/2026
9.0.17 32 06/10/2026
9.0.16 37 05/13/2026
9.0.15 57 04/16/2026
9.0.14 59 03/14/2026
9.0.13 65 02/11/2026
9.0.12 62 01/14/2026
9.0.11 64 12/12/2025
9.0.10 61 12/11/2025
9.0.9 51 12/12/2025
9.0.8 62 12/11/2025
9.0.7 55 12/11/2025
9.0.6 6 09/30/2026
9.0.5 54 12/12/2025
9.0.4 11 10/05/2026
9.0.3 53 12/12/2025
9.0.2 6 10/10/2026
9.0.1 59 12/11/2025
9.0.0 57 12/12/2025
9.0.0-rc.2.24473.5 13 10/08/2026
9.0.0-rc.1.24431.7 62 12/12/2025
9.0.0-preview.7.24405.7 72 12/11/2025
9.0.0-preview.6.24327.7 54 12/12/2025
9.0.0-preview.5.24306.7 55 12/12/2025
9.0.0-preview.4.24266.19 45 12/12/2025
9.0.0-preview.3.24172.9 12 09/28/2026
9.0.0-preview.2.24128.5 51 12/11/2025
9.0.0-preview.1.24080.9 56 12/12/2025
8.0.0 682 09/28/2026
8.0.0-rc.2.23479.6 49 12/12/2025
8.0.0-rc.1.23419.4 51 12/11/2025
8.0.0-preview.7.23375.6 38 12/13/2025
8.0.0-preview.6.23329.7 18 09/29/2026
8.0.0-preview.5.23280.8 57 12/12/2025
8.0.0-preview.4.23259.5 14 10/01/2026
8.0.0-preview.3.23174.8 55 12/13/2025
8.0.0-preview.2.23128.3 60 12/13/2025
8.0.0-preview.1.23110.8 51 12/15/2025
7.0.0 49 12/20/2025
7.0.0-rc.2.22472.3 54 12/15/2025
7.0.0-rc.1.22426.10 49 12/13/2025
7.0.0-preview.7.22375.6 59 12/11/2025
7.0.0-preview.6.22324.4 54 12/11/2025
7.0.0-preview.5.22301.12 51 12/13/2025
7.0.0-preview.4.22229.4 14 10/08/2026
7.0.0-preview.3.22175.4 61 12/12/2025
7.0.0-preview.2.22152.2 52 12/13/2025
7.0.0-preview.1.22076.8 51 12/13/2025
6.0.2 49 12/15/2025
6.0.2-mauipre.1.22102.15 16 10/03/2026
6.0.2-mauipre.1.22054.8 55 12/14/2025
6.0.1 50 12/13/2025
6.0.0 6 10/07/2026
6.0.0-rc.2.21480.5 55 12/11/2025
6.0.0-rc.1.21451.13 49 12/12/2025
6.0.0-preview.7.21377.19 57 12/11/2025
6.0.0-preview.6.21352.12 57 12/13/2025