DeterministicGuids 1.0.12

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

DeterministicGuids DeterministicGuids

GitHub Workflow Status NuGet NuGet Codacy Grade Codecov

A small, allocation-conscious, thread-safe .NET utility for generating name-based deterministic UUIDs (a.k.a. GUIDs) using RFC 9562 v3 (MD5), v5 (SHA-1) and v8 (SHA-256).

You give it:

  • a namespace GUID (for a logical domain like "Orders", "Users", "Events")
  • a name (string within that namespace)
  • and (optionally) the UUID version (3, 5 or 8).
    If you don't specify it, it defaults to version 5 (SHA-1). v8 is implemented using SHA-256.

It will always return the same GUID for the same (namespace, name, version) triplet.

This is useful for:

  • Stable IDs across services or deployments
  • Idempotent commands / events
  • Importing external data but keeping predictable identifiers
  • Deriving IDs from business keys without storing a lookup table

Features

  • ✅ Deterministic
    Same (namespace, name, version) → same output every time.

  • ✅ Standards-based
    Implements RFC 9562 §5.3 for UUIDv3 (MD5-based), RFC 9562 §5.5 UUIDv5 (SHA-1-based) and RFC 9562 §5.8 for UUIDv8 (SHA-256-based).

  • ✅ Thread-safe
    No shared mutable state, no static caches, no locks. You can call it from many threads at once.

  • ✅ Optimized memory profile

    • Uses Span<byte> and stackalloc for fixed-size work.
    • Uses ArrayPool<byte> for variable-length buffers (the UTF-8 input string), instead of allocating on every call.
    • Uses incremental hashing on modern runtimes, so we never build a giant namespace+name concatenated array.
  • ✅ Zero runtime GUID parsing for known namespaces
    Namespaces are defined using the numeric Guid constructor, not Guid.Parse(...), so there is no string parsing cost at first use.

  • ✅ Multi-targeted

    • netstandard2.0
    • netstandard2.1
    • net5.0
    • net6.0
    • net7.0
    • net8.0
    • net11.0 (and above)

On newer targets we take advantage of newer BCL APIs to reduce allocations to zero.

Quick Start

using DeterministicGuids;

// Choose a namespace (either one of the built-ins or your own Guid)
var ns = DeterministicGuid.Namespaces.Events;

// Define the stable name/key within that namespace
var key = "order:12345";

// Generate a deterministic GUID.
// This uses version 5 (SHA-1) by default.
Guid idV5 = DeterministicGuid.Create(ns, key);

Console.WriteLine(idV5);
// Same ns + key + version (5) will always produce the same Guid

Benchmarks

DeterministicGuids stacks very well against other libraries in terms of speed, whilst being allocation-free. Here are some benchmarks with values taken directly from a run in GitHub Actions.

.NET 11.0.0 (11.0.0, 11.0.26.53018), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Median Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.019 us 0.0020 us 0.0016 us 1.019 us 1.00 0.00 - -
UUIDNext 1.029 us 0.0090 us 0.0080 us 1.028 us 1.01 0.01 - -
SequentialGuid 1.140 us 0.0027 us 0.0023 us 1.140 us 1.12 0.00 - -
NGuid 1.149 us 0.0121 us 0.0113 us 1.142 us 1.13 0.01 - -
Enbrea.GuidFactory 1.202 us 0.0078 us 0.0073 us 1.203 us 1.18 0.01 0.0305 536 B
Be.Vlaanderen...Deterministic 1.479 us 0.0131 us 0.0109 us 1.476 us 1.45 0.01 0.0744 1272 B
GuidPhantom 1.488 us 0.0129 us 0.0107 us 1.485 us 1.46 0.01 0.0744 1272 B
Elephant.Uuidv5Utilities 1.703 us 0.0341 us 0.1000 us 1.648 us 1.67 0.10 0.0763 1304 B
unique 1.728 us 0.0096 us 0.0080 us 1.733 us 1.70 0.01 0.0916 1560 B

.NET 10.0.15 (10.0.15, 10.0.1526.53008), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.032 us 0.0086 us 0.0081 us 1.00 0.00 - -
UUIDNext 1.044 us 0.0091 us 0.0086 us 1.01 0.01 - -
NGuid 1.145 us 0.0025 us 0.0020 us 1.11 0.01 - -
SequentialGuid 1.150 us 0.0105 us 0.0098 us 1.11 0.01 - -
Enbrea.GuidFactory 1.204 us 0.0076 us 0.0067 us 1.17 0.01 0.0305 536 B
Be.Vlaanderen...Deterministic 1.502 us 0.0110 us 0.0103 us 1.46 0.01 0.0744 1272 B
GuidPhantom 1.514 us 0.0124 us 0.0116 us 1.47 0.02 0.0744 1272 B
Elephant.Uuidv5Utilities 1.664 us 0.0237 us 0.0221 us 1.61 0.02 0.0763 1304 B
unique 1.783 us 0.0125 us 0.0117 us 1.73 0.02 0.0916 1560 B

.NET 9.0.23 (9.0.23, 9.0.2326.52216), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.047 us 0.0105 us 0.0088 us 1.00 0.01 - -
UUIDNext 1.053 us 0.0113 us 0.0105 us 1.01 0.01 - -
NGuid 1.164 us 0.0113 us 0.0100 us 1.11 0.01 - -
SequentialGuid 1.171 us 0.0109 us 0.0102 us 1.12 0.01 - -
Enbrea.GuidFactory 1.203 us 0.0076 us 0.0071 us 1.15 0.01 0.0305 536 B
GuidPhantom 1.503 us 0.0059 us 0.0046 us 1.44 0.01 0.0744 1272 B
Be.Vlaanderen...Deterministic 1.513 us 0.0137 us 0.0128 us 1.44 0.02 0.0744 1272 B
Elephant.Uuidv5Utilities 1.652 us 0.0125 us 0.0117 us 1.58 0.02 0.0763 1304 B
unique 1.812 us 0.0141 us 0.0132 us 1.73 0.02 0.0954 1600 B

.NET 8.0.34 (8.0.34, 8.0.3426.52217), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.033 us 0.0098 us 0.0092 us 1.00 0.01 - -
UUIDNext 1.061 us 0.0098 us 0.0087 us 1.03 0.01 - -
NGuid 1.156 us 0.0064 us 0.0057 us 1.12 0.01 - -
SequentialGuid 1.170 us 0.0074 us 0.0069 us 1.13 0.01 - -
Enbrea.GuidFactory 1.209 us 0.0051 us 0.0045 us 1.17 0.01 0.0305 536 B
Be.Vlaanderen...Deterministic 1.509 us 0.0126 us 0.0112 us 1.46 0.02 0.0744 1264 B
GuidPhantom 1.527 us 0.0119 us 0.0111 us 1.48 0.02 0.0744 1264 B
Elephant.Uuidv5Utilities 1.682 us 0.0158 us 0.0148 us 1.63 0.02 0.0763 1296 B
unique 1.846 us 0.0119 us 0.0112 us 1.79 0.02 0.0935 1592 B

.NET 7.0.20 (7.0.20, 7.0.2024.26716), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.079 us 0.0075 us 0.0070 us 1.00 0.00 - -
UUIDNext 1.097 us 0.0012 us 0.0010 us 1.02 0.01 - -
NGuid 1.185 us 0.0062 us 0.0058 us 1.10 0.01 - -
SequentialGuid 1.533 us 0.0126 us 0.0118 us 1.42 0.01 0.0458 768 B
Be.Vlaanderen...Deterministic 1.598 us 0.0095 us 0.0084 us 1.48 0.01 0.0744 1264 B
GuidPhantom 1.608 us 0.0114 us 0.0101 us 1.49 0.01 0.0744 1264 B
Elephant.Uuidv5Utilities 1.802 us 0.0184 us 0.0172 us 1.67 0.02 0.0763 1296 B
unique 1.997 us 0.0224 us 0.0210 us 1.85 0.02 0.0916 1592 B

.NET 6.0.36 (6.0.36, 6.0.3624.51421), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.070 us 0.0096 us 0.0090 us 1.00 0.00 - -
UUIDNext 1.114 us 0.0074 us 0.0065 us 1.04 0.01 - -
NGuid 1.200 us 0.0078 us 0.0073 us 1.12 0.01 - -
SequentialGuid 1.479 us 0.0134 us 0.0125 us 1.38 0.02 0.0458 768 B
Be.Vlaanderen...Deterministic 1.547 us 0.0077 us 0.0064 us 1.45 0.01 0.0744 1264 B
GuidPhantom 1.564 us 0.0162 us 0.0152 us 1.46 0.02 0.0744 1264 B
Elephant.Uuidv5Utilities 1.761 us 0.0131 us 0.0123 us 1.65 0.02 0.0763 1296 B
unique 1.985 us 0.0263 us 0.0246 us 1.86 0.03 0.0916 1592 B

.NET 5.0.17 (5.0.17, 5.0.1722.21314), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.069 us 0.0020 us 0.0015 us 1.00 0.00 - -
UUIDNext 1.139 us 0.0016 us 0.0013 us 1.07 0.00 - -
SequentialGuid 1.484 us 0.0096 us 0.0080 us 1.39 0.01 0.0458 768 B
GuidPhantom 1.584 us 0.0145 us 0.0136 us 1.48 0.01 0.0744 1264 B
Elephant.Uuidv5Utilities 1.801 us 0.0188 us 0.0175 us 1.68 0.02 0.0763 1296 B
NGuid 1.819 us 0.0143 us 0.0133 us 1.70 0.01 0.0820 1376 B
unique 2.022 us 0.0161 us 0.0134 us 1.89 0.01 0.0916 1592 B

.NET Core 3.1.32 (3.1.32, 4.700.22.55902), X64 RyuJIT VectorSize=256

Method Mean Error StdDev Ratio RatioSD Gen0 Allocated
DeterministicGuids 1.137 us 0.0067 us 0.0059 us 1.00 0.00 - -
UUIDNext 1.170 us 0.0102 us 0.0095 us 1.03 0.01 - -
SequentialGuid 1.552 us 0.0188 us 0.0176 us 1.37 0.02 0.0458 768 B
GuidPhantom 1.696 us 0.0187 us 0.0175 us 1.49 0.02 0.0744 1264 B
Elephant.Uuidv5Utilities 1.930 us 0.0151 us 0.0134 us 1.70 0.01 0.0763 1296 B
NGuid 1.884 us 0.0168 us 0.0149 us 1.66 0.02 0.0801 1376 B
unique 2.482 us 0.0165 us 0.0146 us 2.18 0.02 0.0916 1592 B

.NET Framework 4.8.1 (4.8.9363.0), X64 RyuJIT VectorSize=256

Method Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
DeterministicGuids 2.816 us 0.0134 us 0.0112 us 1.00 0.00 0.0305 0.0038 209 B 1.00
UUIDNext 2.661 us 0.0193 us 0.0181 us 0.94 0.01 0.1106 0.0038 698 B 3.34
Elephant.Uuidv5Utilities 3.661 us 0.0188 us 0.0166 us 1.30 0.01 0.2403 0.0038 1533 B 7.33
SequentialGuid 3.426 us 0.0295 us 0.0261 us 1.22 0.01 0.2480 0.0038 1573 B 7.53
GuidPhantom 4.101 us 0.0249 us 0.0221 us 1.46 0.01 0.2441 0.0076 1581 B 7.56
unique 5.008 us 0.0378 us 0.0335 us 1.78 0.01 0.2975 0.0076 1910 B 9.14
NGuid 9.998 us 0.0877 us 0.0821 us 3.55 0.03 0.4578 0.0153 2937 B 14.05

Credits

Check out our list of contributors!

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  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 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.  net11.0 is compatible. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • .NETStandard 2.1

    • No dependencies.
  • net11.0

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • 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
1.0.12 157 11/15/2026
1.0.11 81,635 4/26/2026
1.0.11-rc3 126 4/26/2026
1.0.11-rc2 132 4/26/2026
1.0.11-alpha 162 4/26/2026
1.0.10 13,279 2/10/2026
1.0.9 1,489 1/24/2026
1.0.8 685 1/14/2026
1.0.7 20,336 12/17/2025
1.0.6 1,035 12/6/2025
1.0.5 12,324 11/2/2025
1.0.4 187 11/1/2025
1.0.3 251 10/27/2025
1.0.2 248 10/26/2025
1.0.0 262 10/26/2025

Support for .NET 11.0.