Guid

  • Thread starter Thread starter newbienew
  • Start date Start date
N

newbienew

What is the maximum value of a GUID... is it possible to get the
maximum value from a method or property like Guid.Empty?
 
newbienew said:
What is the maximum value of a GUID... is it possible to get the
maximum value from a method or property like Guid.Empty?

The GUID is a 128-bit number, so the "maximum" value would appear to be 2
to the 128th power minus one. However, this doesn't make much sense: the
GUIDs are normally built from a mostly random combination of ones and
zeroes, so they don't follow any particular order, so the "maximum" is
really meaningless.
 
A guid is internally just a 16 byte number, so the largest guid would
presumably be new Guid(new byte[]
{255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255})
(there should be 16 there!)

However! guids aren't about size... they are abount distribution -
hence I'm not sure it is useful to talk about a Guid.MaxValue... Empty
*is* useful, however, as a means to discuss e.g. a guid that hasn't
been generated yet.

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top