JeremyEspresso.MurmurHash
0.0.1
dotnet add package JeremyEspresso.MurmurHash --version 0.0.1
NuGet\Install-Package JeremyEspresso.MurmurHash -Version 0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
For projects that support PackageReference, copy this XML node into the project file to reference the package.
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JeremyEspresso.MurmurHash --version 0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JeremyEspresso.MurmurHash, 0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JeremyEspresso.MurmurHash@0.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JeremyEspresso.MurmurHash&version=0.0.1
#tool nuget:?package=JeremyEspresso.MurmurHash&version=0.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MurmurHash
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.
NuGet
Get MurmurHash on NuGet: https://www.nuget.org/packages/JeremyEspresso.MurmurHash
API Usage
using MurmurHash;
string input = "Hello World!";
const uint seed = 420;
ReadOnlySpan inputSpan = Encoding.UTF8.GetBytes(input).AsSpan();
uint hash = MurmurHash3.Hash32(ref inputSpan, seed);
Console.WriteLine(hash);
Output:
1535517821
Benchmarks
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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on JeremyEspresso.MurmurHash:
| Package | Downloads |
|---|---|
|
Kurrent.Surge.Core
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1 | 121,511 | 1/3/2023 |