System.IO.Hashing 11.0.0-preview.4.26230.115

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
Microsoft.Build.Tasks.Git
MSBuild tasks providing git repository information.
24
Microsoft.Build.Tasks.Git
MSBuild tasks providing git repository information.
25
Microsoft.Build.Tasks.Git
MSBuild tasks providing git repository information.
27
Microsoft.Build.Tasks.Git
MSBuild tasks providing git repository information.
28
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
97
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
101
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
109
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
114
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
122
Microsoft.Extensions.Http.Resilience
Resilience mechanisms for HTTP Client.
124
Microsoft.SourceLink.GitHub
Generates source link for GitHub repositories.
27
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
24
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
25
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
26
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
28
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
31
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
39
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
62
StackExchange.Redis
High performance Redis client, incorporating both synchronous and asynchronous usage.
97

https://go.microsoft.com/fwlink/?LinkID=799421

.NET 10.0

  • No dependencies.

.NET 11.0

  • No dependencies.

.NET Framework 4.6.2

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.4.26230.115 10 05/13/2026
11.0.0-preview.3.26207.106 20 04/14/2026
11.0.0-preview.2.26159.112 21 03/12/2026
11.0.0-preview.1.26104.118 24 02/11/2026
10.0.8 11 05/13/2026
10.0.7 18 04/21/2026
10.0.6 21 04/14/2026
10.0.5 24 03/13/2026
10.0.4 24 03/12/2026
10.0.3 34 02/11/2026
10.0.2 32 01/13/2026
10.0.1 38 12/12/2025
10.0.0 58 11/13/2025
10.0.0-rc.2.25502.107 75 10/15/2025
10.0.0-rc.1.25451.107 77 09/09/2025
10.0.0-preview.7.25380.108 75 08/13/2025
10.0.0-preview.6.25358.103 75 07/16/2025
10.0.0-preview.5.25277.114 87 06/07/2025
10.0.0-preview.4.25258.110 91 05/16/2025
10.0.0-preview.3.25171.5 89 04/12/2025
10.0.0-preview.2.25163.2 97 04/01/2025
10.0.0-preview.1.25080.5 91 04/01/2025
9.0.16 10 05/13/2026
9.0.15 18 04/14/2026
9.0.14 22 03/12/2026
9.0.13 27 02/11/2026
9.0.12 27 01/13/2026
9.0.11 55 11/13/2025
9.0.10 78 10/15/2025
9.0.9 70 09/09/2025
9.0.8 72 08/06/2025
9.0.7 94 07/09/2025
9.0.6 91 06/11/2025
9.0.5 73 05/17/2025
9.0.4 94 04/10/2025
9.0.3 94 03/31/2025
9.0.2 93 03/31/2025
9.0.1 91 04/01/2025
9.0.0 97 04/01/2025
9.0.0-rc.2.24473.5 88 03/31/2025
9.0.0-rc.1.24431.7 89 03/31/2025
9.0.0-preview.7.24405.7 85 04/01/2025
9.0.0-preview.6.24327.7 115 04/01/2025
9.0.0-preview.5.24306.7 99 04/01/2025
9.0.0-preview.4.24266.19 85 03/31/2025
9.0.0-preview.3.24172.9 88 03/31/2025
9.0.0-preview.2.24128.5 85 04/01/2025
9.0.0-preview.1.24080.9 101 04/01/2025
8.0.0 96 04/01/2025
8.0.0-rc.2.23479.6 96 04/01/2025
8.0.0-rc.1.23419.4 96 04/01/2025
8.0.0-preview.7.23375.6 97 03/31/2025
8.0.0-preview.6.23329.7 95 04/01/2025
8.0.0-preview.5.23280.8 93 04/01/2025
8.0.0-preview.4.23259.5 103 04/01/2025
8.0.0-preview.3.23174.8 95 04/01/2025
8.0.0-preview.2.23128.3 103 04/01/2025
8.0.0-preview.1.23110.8 91 03/31/2025
7.0.0 90 04/01/2025
7.0.0-rc.2.22472.3 82 04/01/2025
7.0.0-rc.1.22426.10 88 04/01/2025
7.0.0-preview.7.22375.6 88 04/01/2025
7.0.0-preview.6.22324.4 95 04/01/2025
7.0.0-preview.5.22301.12 82 04/01/2025
7.0.0-preview.4.22229.4 97 04/01/2025
7.0.0-preview.3.22175.4 92 04/01/2025
7.0.0-preview.2.22152.2 102 04/01/2025
7.0.0-preview.1.22076.8 90 04/01/2025
6.0.2 96 03/31/2025
6.0.1 101 04/01/2025
6.0.0 104 04/01/2025
6.0.0-rc.2.21480.5 93 04/01/2025
6.0.0-rc.1.21451.13 89 04/01/2025
6.0.0-preview.7.21377.19 87 03/31/2025
6.0.0-preview.6.21352.12 91 04/01/2025