![]() |
VOOZH | about |
dotnet add package JeremyEspresso.MurmurHash --version 0.0.1
NuGet\Install-Package JeremyEspresso.MurmurHash -Version 0.0.1
<PackageReference Include="JeremyEspresso.MurmurHash" Version="0.0.1" />
<PackageVersion Include="JeremyEspresso.MurmurHash" Version="0.0.1" />Directory.Packages.props
<PackageReference Include="JeremyEspresso.MurmurHash" />Project file
paket add JeremyEspresso.MurmurHash --version 0.0.1
#r "nuget: JeremyEspresso.MurmurHash, 0.0.1"
#:package JeremyEspresso.MurmurHash@0.0.1
#addin nuget:?package=JeremyEspresso.MurmurHash&version=0.0.1Install as a Cake Addin
#tool nuget:?package=JeremyEspresso.MurmurHash&version=0.0.1Install as a Cake Tool
A super fast implementation of the MurmurHash3 algorithm with zero heap allocations.
The initial implementation was based on https://github.com/odinmillion/MurmurHash.Net. Except for the magic constants there is not much left of the original implementation.
Get MurmurHash on NuGet: https://www.nuget.org/packages/JeremyEspresso.MurmurHash
using MurmurHash;
string input = "Hello World!";
const uint seed = 420;
ReadOnlySpan<byte> inputSpan = Encoding.UTF8.GetBytes(input).AsSpan();
uint hash = MurmurHash3.Hash32(ref inputSpan, seed);
Console.WriteLine(hash);
Output:
1535517821
BenchmarkDotNet=v0.13.3, OS=Windows 10 (10.0.19045.2364)
Intel Core i7-9700K CPU 3.60GHz (Coffee Lake), 1 CPU, 8 logical and 8 physical cores
.NET SDK=7.0.101
[Host] : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
DefaultJob : .NET 7.0.1 (7.0.122.56804), X64 RyuJIT AVX2
| Method | StringInput | Mean | Error | StdDev | Allocated |
|---|---|---|---|---|---|
| MurMurHash3 | !zhg(...)9N!% [128] | 28.540 ns | 0.6031 ns | 0.9909 ns | - |
| OdinMillion_MurMurHashDotNet | !zhg(...)9N!% [128] | 39.308 ns | 0.8142 ns | 1.1934 ns | - |
| MurMurHash3 | a$6aj(...)5HFPe [40] | 9.142 ns | 0.2075 ns | 0.2625 ns | - |
| OdinMillion_MurMurHashDotNet | a$6aj(...)5HFPe [40] | 12.032 ns | 0.2711 ns | 0.3620 ns | - |
| MurMurHash3 | key | 1.801 ns | 0.0643 ns | 0.0858 ns | - |
| OdinMillion_MurMurHashDotNet | key | 4.415 ns | 0.1052 ns | 0.1542 ns | - |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on JeremyEspresso.MurmurHash:
| Package | Downloads |
|---|---|
|
Kurrent.Surge.Core
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1 | 97,333 | 1/3/2023 |