I've got a bunch of servers running this Linux app. I'd like for them to be able to generate a GUID with a low probability of collision. I'm sure I could just pull 128 bytes out of /dev/urandom and that would probably be fine, but is there a simple & easy way to generate a GUID that is more equivalent to the Win32 one? Specifically, one that takes into account space (well, MAC address), time, and randomness? I don't want to call off the box for it, I just want something like CreateGuid()
+1
A:
Look here: http://stackoverflow.com/questions/87127/guid-behind-the-scenes
P.S. This is not a duplicate question - the best answer would point to a publicly available source.
Mark Ransom
2008-09-30 15:55:11
+4
A:
This Internet Draft describes one type of UUID in great details and I have used a similar approach with great success when I needed a UUID implementation and could not link to an existing library for architectural reasons.
This article provides a good overview.
David Segonds
2008-09-30 15:58:10
From looking at that second link, I found libuuid (http://linux.die.net/man/3/libuuid), which seems to be exactly what I need. Thanks!
twk
2008-09-30 17:02:26
I am glad I was able to help.
David Segonds
2008-09-30 17:04:30
+2
A:
If you are going to use something then an Internet standard would be a good idea:
Check out RFC (Request For Comment).
The one I know that is specific to GUID is: RFC 4122
Martin York
2008-09-30 15:59:06
It would be wonderful if there were a non-LGPL (and non-GPL) library.
jeffamaphone
2009-10-27 16:04:00