HashifyNet 4.0.0-beta
See the version list below for details.
dotnet add package HashifyNet --version 4.0.0-beta
NuGet\Install-Package HashifyNet -Version 4.0.0-beta
<PackageReference Include="HashifyNet" Version="4.0.0-beta" />
<PackageVersion Include="HashifyNet" Version="4.0.0-beta" />
<PackageReference Include="HashifyNet" />
paket add HashifyNet --version 4.0.0-beta
#r "nuget: HashifyNet, 4.0.0-beta"
#:package HashifyNet@4.0.0-beta
#addin nuget:?package=HashifyNet&version=4.0.0-beta&prerelease
#tool nuget:?package=HashifyNet&version=4.0.0-beta&prerelease
HashifyNET
HashifyNET is a C# library to create a common interface to non-cryptographic hash functions and to cryptographic hash functions and provide implementations of public hash functions.
All functionality of the library is tested using xUnit. A primary requirement for each release is 100% code coverage by these tests. All code within the libarary is commented using Visual Studio-compatible XML comments.
You can join our Discord at https://discord.gg/PrKery9 any time you'd need support or just to join our Family.
Implementations
The following hash functions have been implemented from the most reliable reference that could be found:
- Bernstein Hash
- BernsteinHash - Original
- ModifiedBernsteinHash - Minor update that is said to result in better distribution
- Blake2
- Blake2b
- Blake3
- Blake3
- BuzHash
- BuzHashBase - Abstract implementation, there is no authoritative implementation
- DefaultBuzHash - Concrete implementation, uses 256 random 64-bit integers
- CityHash
- CRC
- CRC - Generalized implementation to allow any CRC parameters between 1 and 64 bits.
- CRCStandards - 71 implementations on top of CRC that use the parameters defined by their respective standard. Standards and their parameters provided by CRC RevEng's catalogue.
- ELF64
- FNV
- FNV1Base - Abstract base of the FNV-1 algorithms
- FNV1 - Original
- FNV1a - Minor variation of FNV-1
- Hash Algorithm Wrapper
- HashAlgorithmWrapper - Wraps existing instance of a .Net HashAlgorithm
- HashAlgorithmWrapper<HashAlgorithmT> - Wraps a managed instance of a .Net HashAlgorithm
- Jenkins
- JenkinsOneAtATime - Original
- JenkinsLookup2 - Improvement upon One-at-a-Time hash function
- JenkinsLookup3 - Further improvement upon Jenkins' Lookup2 hash function
- Murmur Hash
- MurmurHash1 - Original
- MurmurHash2 - Improvement upon MurmurHash1
- MurmurHash3 - Further improvement upon MurmurHash2, addresses minor flaws
- Pearson hashing
- PearsonBase - Abstract implementation, there is no authoritative implementation
- WikipediaPearson - Concrete implementation, uses values from Wikipedia article
- SpookyHash
- SpookyHashV1 - Original
- SpookyHashV2 - Improvement upon SpookyHashV1, fixes bug in original specification
- xxHash
- xxHash - Original and 64-bit version.
- Gost
- Gost - Implementation of Streebog Family (GOST R 34.11-2012).
- SM3
- SM3
- SipHash
- SipHash
- Adler32
- Adler32
- HighwayHash
- HighwayHash
- Tiger
- Tiger - Original
- Tiger2 - The padding in the beginning of the algorithm changes from 0x01 to 0x80. This is the only difference from the original Tiger algorithm.
- Whirlpool
- Whirlpool
- Keccak
- Keccak - Implementation of both with SHA-3 padding and with original Keccak padding.
- Argon2id
- Argon2id - Implements through a custom Isopoh Cryptography code that uses our Blake2B implementation (without any dependency) - https://github.com/mheyman/Isopoh.Cryptography.Argon2
Differences
This library is the successor to https://github.com/Deskasoft/Data.HashFunction. While keeping the API structure mostly same, the biggest change this library brings is the clearence of dependency overhaul previously caused by Data.HashFunction. Every hash algorithm is now collected under one, single assembly and package named HashifyNET and all of the namespaces are shortcuted to HashifyNet.
The former factory-based implementation, which assigned a unique factory to each hash function, has been superseded by a more modular and centralized factory. This new model provides superior accessibility and efficiency.
As an addition, we introduced 11 more hash algorithms, sorted below:
- Adler32
- Blake3
- Gost
- HighwayHash
- SipHash
- Tiger
- Tiger2
- Whirlpool
- SM3
- Keccak
- Argon2id
Usage
Usage for all hash functions has been further standardized and is now accessible through the HashifyNet.HashFactory
class.
The HashifyNet.HashFactory
class supports both generics and with access to each hash function via System.Type
.
To access a hash function via generics, you can do this:
using System;
using HashifyNet;
using HashifyNet.Algorithms.Adler32;
public class Program
{
static void Main()
{
IAdler32 adler32 = HashFactory<IAdler32>.Instance.Create();
IHashValue computedHash = adler32.ComputeHash("foobar");
Console.WriteLine(computedHash.AsHexString());
}
}
To access a hash function via System.Type
, you can do this:
using System;
using HashifyNet;
using HashifyNet.Algorithms.Adler32;
public class Program
{
static void Main()
{
IAdler32 adler32 = HashFactory.Instance.Create(typeof(IAdler32));
IHashValue computedHash = adler32.ComputeHash("foobar");
Console.WriteLine(computedHash.AsHexString());
}
}
There are a lot more changes made to the library and feel free to explore them by adding into your project. We'd love to see what you are going to do or have done with our library so feel free to share them with us at https://discord.gg/PrKery9.
Release Notes
See Release Notes wiki page.
Versioning Guarantees
This library generally abides by Semantic Versioning. Packages are published in MAJOR.MINOR.PATCH
version format.
Patch component
An increment of the PATCH component always indicates that an internal-only change was made, generally a bug fix. These changes will not affect the public-facing API in any way, and are always guaranteed to be forward/backwards-compatible with your codebase, any pre-compiled dependencies of your codebase.
Minor component
An increment of the MINOR component indicates that some addition was made to the library, and this addition may not be backwards-compatible with prior versions.
Major component
An increment of the MAJOR component indicates that breaking changes have been made to the library; consumers should check the release notes to determine what changes need to be made.
Contributing
Feel free to propose changes, notify of issues, or contribute code using GitHub! Submit issues and/or pull requests as necessary.
There are no special requirements for change proposal or issue notifications.
Code contributions should follow existing code's methodologies and style, along with XML comments for all public and protected namespaces, classes, and functions added.
License
HashifyNET is released under the terms of the MIT license. See LICENSE for more information or see http://opensource.org/licenses/MIT.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.6.3)
-
net8.0
- System.Memory (>= 4.6.3)
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 |
---|---|---|
5.0.1 | 64 | 9/7/2025 |
5.0.0 | 145 | 9/3/2025 |
4.0.1 | 159 | 8/29/2025 |
4.0.0-beta | 297 | 8/29/2025 |