RngHashGenerator 1.0.2
dotnet add package RngHashGenerator --version 1.0.2
NuGet\Install-Package RngHashGenerator -Version 1.0.2
<PackageReference Include="RngHashGenerator" Version="1.0.2" />
<PackageVersion Include="RngHashGenerator" Version="1.0.2" />
<PackageReference Include="RngHashGenerator" />
paket add RngHashGenerator --version 1.0.2
#r "nuget: RngHashGenerator, 1.0.2"
#:package RngHashGenerator@1.0.2
#addin nuget:?package=RngHashGenerator&version=1.0.2
#tool nuget:?package=RngHashGenerator&version=1.0.2
RngHashGenerator
A small utility library for deterministic hash generation, HMAC-SHA512 hashing, timestamp handling, and secure random seed generation.
Designed for scenarios like:
- Game RNG validation
- Provably fair systems
- Deterministic hash chains
- Reproducible randomness based on inputs
Features
- ๐ HMAC-SHA512 hashing
- โฑ Unix milliseconds โ DateTime conversion
- ๐ Deterministic hash generation from multiple inputs
- ๐ฒ Cryptographically secure random seed generation
- ๐งพ Hex string encoding for binary data
Installation
Add the project or compiled DLL as a reference to your solution.
NuGet dependency:
dotnet add package UUIDNext
Usage
Generate a Random Seed
Creates a cryptographically secure random UUID. Example output:
e4b8a9c6d5b94b6b8a8fd6c2a4b1e987
Convert Unix Milliseconds to DateTime
DateTime date = RngService.FromMs(1700000000000);
Uses Unix epoch (1970-01-01 UTC) as the base.
Compute HMAC-SHA512
string hash = RngService.Hmac512("message", "secret-key");
Deterministic Hash Generation
string hash = RngService.Hash(
ss: "server-seed",
cs: "client-seed",
n: 42,
ms: 1700000000000
);
This makes the output:
- Deterministic
- Time-bound
- Reproducible for verification
- Perfect for provably fair or turn-based game logic.
Notes
All hashing is deterministic given the same inputs No global state, fully thread-safe Time formatting is precise to milliseconds Suitable for server-side validation logic
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- UUIDNext (>= 4.2.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.