⚠ Deprecated: Legacy
Data.HashFunction has been superseded by HashifyNET, the new version (4.x.x) of Data.HashFunction. Please move to HashifyNET for further support with security, bug fixes, and new features.
Suggested alternative: HashifyNet
Data.HashFunction implementation of the cyclic redundancy check (CRC) error-detecting code (http://en.wikipedia.org/wiki/Cyclic_redundancy_check). Implementation is generalized to encompass all possible CRC parameters from 1 to 64 bits.
$ dotnet add package Data.HashFunction.CRCThe usage for all hash functions has been standardized and is accessible via the Data.HashFunction.IHashFunction and Data.HashFunction.IHashFunctionAsync interfaces. The core package, Data.HashFunction.Core, only contains abstract hash function implementations and base functionality for the library. In order to use a specific hashing algorithms, you will need to reference its implementation packages.
IHashFunction implementations should be immutable and stateles. All IHashFunction methods and members should be thread safe.
using System;
using Data.HashFunction;
using Data.HashFunction.Jenkins;
public class Program
{
public static readonly IJenkinsOneAtATime _jenkinsOneAtATime = JenkinsOneAtATimeFactory.Instance.Create();
public static void Main()
{
var hashValue = _jenkinsOneAtATime.ComputeHash("foobar");
Console.WriteLine(hashValue.AsHexString());
}
}
See Release Notes wiki page.
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.
Data.HashFunction is released under the terms of the MIT license. See LICENSE for more information or see http://opensource.org/licenses/MIT.