RngHashGenerator 1.0.2

dotnet add package RngHashGenerator --version 1.0.2
                    
NuGet\Install-Package RngHashGenerator -Version 1.0.2
                    
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.
<PackageReference Include="RngHashGenerator" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RngHashGenerator" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="RngHashGenerator" />
                    
Project file
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 RngHashGenerator --version 1.0.2
                    
#r "nuget: RngHashGenerator, 1.0.2"
                    
#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 RngHashGenerator@1.0.2
                    
#: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=RngHashGenerator&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=RngHashGenerator&version=1.0.2
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.2 147 1/28/2026
1.0.1 97 1/27/2026