Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GUID with a always equal number [duplicate]

Tags:

c#

guid

Why in the middle of every GUID that this computer generates, we can see a 4?

enter image description here

like image 425
Marco Salerno Avatar asked Sep 05 '17 08:09

Marco Salerno


2 Answers

It's GUID algorithm version (4 in your case):

https://en.wikipedia.org/wiki/Universally_unique_identifier

In its canonical textual representation, the sixteen octets of a UUID are represented as 32 hexadecimal (base 16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:

123e4567-e89b-12d3-a456-426655440000
xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx

The four bits of digit M indicate the UUID version, and the one to three most significant bits of digit N indicate the UUID variant. In the example, M is 1 and N is a (10xx), meaning that the UUID is a variant 1, version 1 UUID; that is, a time-based DCE/RFC 4122 UUID.

like image 170
Dmitry Bychenko Avatar answered Oct 16 '22 16:10

Dmitry Bychenko


This is due to the version of GUID/UUID's that are being used;

Some good information can be found here, but basicly these are version 4 which uses the following format:

 xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
like image 30
Tom Avatar answered Oct 16 '22 16:10

Tom