.NET GUID Generation library
C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Fixed NuGet package reference path Apr 19, 2016
.gitignore Initial commit Apr 19, 2016
GuidOne.sln initial commit Apr 19, 2016
LICENSE Initial commit Apr 19, 2016
README.md Update README.md Apr 19, 2016

README.md

GuidOne

.NET GUID Generation library behind the project http://guid.one

This library was built as a learning exercise to understand GUIDs - I've made the code available to anyone who is also interested under a permissive license.

This library implements the following GUID generation algorithms specified in RFC 4122

  • Version 1: Date-time and MAC address GUID
  • Version 3: MD5 hash & namespace
  • Version 4: Random
  • Version 5: HA-1 hash & namespace

Visit my blog for a 3-part series that dives into the secret world of GUIDs: https://michael-mckenna.com/tag/guid/

##Usage

var guidV1 = UUID.V1(); //Generate a V1 GUID for current time + random node
var guidV4 = UUID.V4(); //Generate a V4 GUID (random)
var guidV5 = UUID.V5(GuidNamespaces.DNS, "guid.one"); //Generate a V5 GUID for a particular domain

var guid = guidV4.AsGuid(); //Convert to a standard .NET Guid

Note: This library was created just to investigate the inner workings of GUIDs and is not considered production ready