nebulae.dotSipHash
0.1.0
dotnet add package nebulae.dotSipHash --version 0.1.0
NuGet\Install-Package nebulae.dotSipHash -Version 0.1.0
<PackageReference Include="nebulae.dotSipHash" Version="0.1.0" />
<PackageVersion Include="nebulae.dotSipHash" Version="0.1.0" />
<PackageReference Include="nebulae.dotSipHash" />
paket add nebulae.dotSipHash --version 0.1.0
#r "nuget: nebulae.dotSipHash, 0.1.0"
#:package nebulae.dotSipHash@0.1.0
#addin nuget:?package=nebulae.dotSipHash&version=0.1.0
#tool nuget:?package=nebulae.dotSipHash&version=0.1.0
dotSiphash
A minimal, fast, cross-platform SipHash for .NET applications.
This library provides access to the SipHash hashing algorithm, which is a fast and secure hash function designed for short inputs. It is particularly useful for hash tables and other applications where performance and security are critical.
Tests are included and available in the Github repo.
Features
- Easy to use: Simple API for hashing
- Minimal dependencies: No external dependencies required, making it lightweight and easy to integrate.
Requirements
- .NET 8.0 or later
- Windows x64, Linux x64, or macOS (x64 & Apple Silicon)
Usage
dotSipHash is a wrapper around the reference implementation of SipHash. It provides a simple API for hashing data using the SipHash algorithm, which is a fast and secure hash function designed for short inputs.
using nebulae.dotSipHash;
// 16-byte SipHash key (must be exactly 16 bytes)
byte[] key = new byte[16] {
0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F
};
// Data to hash
byte[] message = System.Text.Encoding.UTF8.GetBytes("Hello, SipHash!");
// --- 64-bit hash using byte[] ---
ulong hash64 = SipHash.Compute64(message, key);
// --- 64-bit hash using Span<T> ---
Span<byte> keySpan = key;
Span<byte> dataSpan = message;
ulong hash64Span = SipHash.Compute64(dataSpan, keySpan);
// --- 128-bit hash using byte[] ---
byte[] hash128 = SipHash.Compute128(message, key);
// --- 128-bit hash using Span<T> ---
Span<byte> output = stackalloc byte[16];
bool success = SipHash.TryCompute128(dataSpan, keySpan, output);
Installation
You can install the package via NuGet:
$ dotnet add package nebulae.dotSipHash
Or via git:
$ git clone https://github.com/nebulaeonline/dotSipHash.git
$ cd dotSipHash
$ dotnet build
License
MIT
Roadmap
Unless there are vulnerabilities found, there are no plans to add any new features.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- No dependencies.
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 |
---|---|---|
0.1.0 | 163 | 9/20/2025 |