FastHashes 3.0.0
See the version list below for details.
dotnet add package FastHashes --version 3.0.0
NuGet\Install-Package FastHashes -Version 3.0.0
<PackageReference Include="FastHashes" Version="3.0.0" />
<PackageVersion Include="FastHashes" Version="3.0.0" />
<PackageReference Include="FastHashes" />
paket add FastHashes --version 3.0.0
#r "nuget: FastHashes, 3.0.0"
#:package FastHashes@3.0.0
#addin nuget:?package=FastHashes&version=3.0.0
#tool nuget:?package=FastHashes&version=3.0.0
FastHashes
FashHashes is a suite of .NET non-cryptographic hash functions.
<table> <tr> <td align="right">Status:</td> <td align="left"> <a href="https://github.com/TommasoBelluzzo/FastHashes/actions/workflows/continuous_integration.yml"><img alt="Build" src="https://img.shields.io/github/workflow/status/TommasoBelluzzo/FastHashes/Continuous%20Integration?style=flat&label=Build&color=1081C2"/></a> <a href="https://coveralls.io/github/TommasoBelluzzo/FastHashes?branch=master"><img alt="Coverage" src="https://img.shields.io/coveralls/github/TommasoBelluzzo/FastHashes?style=flat&label=Coverage&color=1081C2"/></a> </td> </tr> <tr> <td align="right">Info:</td> <td align="left"> <a href="#"><img alt="License" src="https://img.shields.io/github/license/TommasoBelluzzo/FastHashes?style=flat&label=License&color=1081C2"/></a> <a href="#"><img alt="Lines" src="https://img.shields.io/tokei/lines/github/TommasoBelluzzo/FastHashes?style=flat&label=Lines&color=1081C2"/></a> <a href="#"><img alt="Size" src="https://img.shields.io/github/repo-size/TommasoBelluzzo/FastHashes?style=flat&label=Size&color=1081C2"/></a> </td> </tr> <tr> <td align="right">NuGet:</td> <td align="left"> <a href="https://www.nuget.org/packages/FastHashes/"><img alt="Version" src="https://img.shields.io/nuget/v/FastHashes?style=flat&label=Version"/></a> <a href="https://www.nuget.org/packages/FastHashes/"><img alt="Downloads" src="https://img.shields.io/nuget/dt/FastHashes?style=flat&label=Downloads&color=1081C2"/></a> </td> </tr> <tr> <td align="right">Donation:</td> <td align="left"> <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T8X35C2FED9SU"><img alt="PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif"/></a> </td> </tr> </table>
Main Features
High Performing: deeply-optimized code makes extensive use of method inlining and unsafe memory pointers in order to speed up the computations.Allocation Free: all the internal functions follow a zero-allocation approach, only primitive types and/or arrays of primitive types are used by the algorithms.Endian-Agnostic: all the hashes provide consistent results regardless of the machine byte order, while only moderately affecting the overall performance of the computations.Platform-Agnostic: the code has been developed under.NET Standardframework and bothx86andx64environments are fully supported.Fully Managed: since version3.0.0, pointers requiring unsafe memory access contexts have been completely removed and the library is now fully managed.
Hashes
The library includes the following non-cryptographic hashes:
FarmHash- 32/64/128 Bits Output
- Fingerprint Versions
- Reference Implementation: https://github.com/google/farmhash
FastHash- 32/64 Bits Output
- Reference Implementation: https://github.com/ZilongTan/fast-hash
FastPositiveHash / TH1A- 64 Bits Output
- 0/1/2 Variants
- Reference Implementation: https://github.com/leo-yuriev/t1ha
HalfSipHash- 32 Bits Output
- Reference Implementation: https://github.com/veorq/SipHash
HighwayHash- 64/128/256 Bits Output
- Reference Implementation: https://github.com/google/highwayhash
MetroHash- 64/128 Bits Output
- 0/1 Variants
- Reference Implementation: https://github.com/jandrewrogers/MetroHash
MirHash- 64 Bits Output
- Reference Implementation: https://github.com/vnmakarov/mir
MumHash- 64 Bits Output
- Reference Implementation: https://github.com/vnmakarov/mum-hash
MurmurHash (v3)- 32/64/128 Bits Output
- x86/x64 Variants
- Reference Implementation: https://github.com/aappleby/smhasher
PengyHash- 64 Bits Output
- Strict Variant
- Reference Implementation: https://github.com/tinypeng/pengyhash
SipHash- 64 Bits Output
- 1-3/2-4 Variants
- Reference Implementation: https://github.com/veorq/SipHash
SpookyHash- 32/64/128 Bits Output
- Reference Implementation: http://burtleburtle.net/bob/hash/spooky.html
xxHash- 32/64 Bits Output
- Reference Implementation: https://github.com/Cyan4973/xxHash
Requirements
The following Frameworks are supported:
- Library:
.NET Standard 2.0,.NET Standard 2.1 - Auxiliary Projects:
.NET Core 2.1,.NET Core 3.1,.NET 5.0,.NET 6.0
The following NuGet packages are required for performing unit tests:
Performance Benchmarks
| Hash Rank | Hash Name | Bulk Speed Test Average ↓ | Chunks Speed Test Average |
|---|---|---|---|
| - | DummyHash (Reference) | 609.34 GB/s | 2.06 GB/s |
| 1 | FarmHash64 | 11.47 GB/s | 626.60 MB/s |
| 2 | FarmHash128 | 11.27 GB/s | 641.03 MB/s |
| 3 | MetroHash128-V1 | 11.11 GB/s | 636.52 MB/s |
| 4 | MetroHash64-V1 | 11.10 GB/s | 628.81 MB/s |
| 5 | MetroHash128-V2 | 11.06 GB/s | 635.34 MB/s |
| 6 | MetroHash64-V2 | 11.05 GB/s | 620.92 MB/s |
| 7 | XxHash64 | 10.03 GB/s | 596.90 MB/s |
| 8 | PengyHash | 8.73 GB/s | 517.22 MB/s |
| 9 | MurmurHash128-x64 | 6.70 GB/s | 485.59 MB/s |
| 10 | MurmurHash64-x64 | 6.56 GB/s | 467.14 MB/s |
| 11 | XxHash32 | 6.43 GB/s | 482.92 MB/s |
| 12 | FastHash64 | 5.34 GB/s | 444.45 MB/s |
| 13 | FastHash32 | 5.26 GB/s | 440.91 MB/s |
| 14 | FarmHash32 | 4.27 GB/s | 394.83 MB/s |
| 15 | FastPositiveHash-V1 | 4.10 GB/s | 386.51 MB/s |
| 16 | MurmurHash128-x86 | 4.05 GB/s | 383.60 MB/s |
| 17 | MurmurHash64-x86 | 4.01 GB/s | 374.73 MB/s |
| 18 | FastPositiveHash_V2 | 3.99 GB/s | 386.33 MB/s |
| 19 | MurmurHash32 | 2.82 GB/s | 332.35 MB/s |
| 20 | MumHash | 2.44 GB/s | 312.24 MB/s |
| 21 | FastPositiveHash-V0 | 2.29 GB/s | 320.69 MB/s |
| 22 | MirHash | 2.03 GB/s | 298.14 MB/s |
| 23 | SipHash-13 | 1.28 GB/s | 230.67 MB/s |
| 24 | HighwayHash256 | 914.16 MB/s | 125.78 MB/s |
| 25 | HighwayHash64 | 899.65 MB/s | 151.54 MB/s |
| 26 | HighwayHash128 | 883.51 MB/s | 143.84 MB/s |
| 27 | SpookyHash32 | 752.43 MB/s | 156.79 MB/s |
| 28 | SpookyHash64 | 734.84 MB/s | 149.36 MB/s |
| 29 | SipHash-24 | 734.74 MB/s | 168.43 MB/s |
| 30 | SpookyHash128 | 723.91 MB/s | 155.67 MB/s |
| 31 | HalfSipHash | 364.78 MB/s | 119.96 MB/s |
The tests above have been conducted with the following machine setup:
CPU:Intel Core i7-7700HQ @2.80GHz (4 Cores, 8 Threads, 256KB L1 Cache)RAM:16 GB x DDR4 SO-DIMM @1200MHzOS:Microsoft Windows 10 64-Bit
| 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 was computed. 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 is compatible. |
| .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.5.5)
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on FastHashes:
| Repository | Stars |
|---|---|
|
BililiveRecorder/BililiveRecorder
录播姬 | mikufans 生放送录制
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.5.0 | 237,990 | 12/15/2022 |
| 3.4.0 | 1,045 | 12/12/2022 |
| 3.3.0 | 4,422 | 9/11/2022 |
| 3.2.0 | 1,670 | 9/6/2022 |
| 3.1.0 | 1,031 | 9/5/2022 |
| 3.0.0 | 1,095 | 8/30/2022 |
| 2.5.0 | 21,323 | 12/9/2021 |
| 2.4.0 | 5,492 | 10/1/2021 |
| 2.3.0 | 1,277 | 10/1/2021 |
| 2.2.0 | 955 | 9/30/2021 |
| 2.1.0 | 1,008 | 9/29/2021 |
| 2.0.0 | 4,325 | 7/17/2021 |
| 1.7.6 | 30,062 | 10/27/2020 |
| 1.7.5 | 2,887 | 7/17/2019 |
| 1.7.4 | 1,301 | 7/16/2019 |
| 1.7.3 | 1,181 | 7/15/2019 |
| 1.7.2 | 1,261 | 7/13/2019 |
| 1.7.1 | 1,237 | 7/12/2019 |
| 1.7.0 | 1,383 | 7/11/2019 |