Skip to main content
GameDev.net gamedev.net
🔒 Locked

GUID

Started by peter86 Dec 28, 2002 at 6:34 AM 4 replies 400+ views
Original Post
peter86
peter86
How do I make my own GUID? Should I just take some randomized digits and letters and put them together? And why this: { 0x590e16dd, 0x538f, 0x40fb, { 0xa7, 0xdf, 0x96, 0x54, 0xea, 0x6b, 0xe7, 0x1e } } Instead of this: { 590E16DD, 538F, 40fb, A7DF, 9654EA6BE71E }?
Neophyte
Neophyte
If you just need to generate a GUID use the exeutable UUIDGEN.
If you need to generate it programatically (which is highly unlikely) use the function CoCreateGuid.

-Neophyte
Neophyte
Neophyte
Oh and by the way, the reason for the ''0x'' thing is to tell the compiler that you''re giving it hexadecimal numbers and not just some jumbled up crap.

-Neophyte
Solo
Solo
quote:

A GUID is a pseudo-unique number, generated mathematically to give the least likely chance of a repeating number on any machine in the world.



Actually, if the machine that generated the GUID has a NIC installed its MAC address is used, yielding a truly unique number.
// Ryan
dalleboy
dalleboy
quote:
Original post by Solo
Actually, if the machine that generated the GUID has a NIC installed its MAC address is used, yielding a truly unique number.

That is depending if you use the UuidCreate function or the UuidCreateSequential function. Read more:
quote:
MSDN
For security reasons, UuidCreate was modified so that it no longer uses a machine''s MAC address to generate UUIDs. UuidCreateSequential was introduced to allow creation of UUIDs using the MAC address of a machine''s Ethernet card.


Update GameDev.net system time campaign: ''date ddmmHHMMYYYY''

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.