8

Just when I generated a GUID, I found some hyphens in between the character and also at specified intervals

8b55fec7-c987-4e7b-abad-16e5aaea9b53

Is there any story behind this?

Note: My intention is to remove those hyphens as I am adding this GUID to a filename and our filename should only be aplhanumeric.

  • 1
    I think it's for readability. Although I must say it's a very strange placement of hyphens if that's the reason for them... – gablin Dec 25 '10 at 22:54
  • A GUID has several fields – JoelFan Feb 26 '15 at 22:15
13

The hyphens are always placed at the same position, so you won't lose any information (or unique-ness) by removing them.

See Stack Overflow: Why are there dashes in a .NET GUID? for a detailed explanation.

6

Long sequences are very hard to parse for humans, hence the hyphens. But GUID itself is just a number, so you can drop them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.