Jump to content
  • Advertisement
Sign in to follow this  
davidgi

GUID Creation

This topic is 4692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone out there ever implemented a GUID (Globally Unique Identifier) generator? This is a globally unique 128-bit number that can be created on any machine such that it doesn't ever create duplicates. Or at least the probability that it will create a duplicate is astronomical. We need a function that will work on Xbox360. Thanks, Dave

Share this post


Link to post
Share on other sites
Advertisement
Nope, always used UuidCreate or CoCreateGuid (both part of Win32). You might want to look into those functions to see if they are available.

Share this post


Link to post
Share on other sites
Use the date/time plus some manipulation. Don't just use date/time if you want persistent GUIDs as the chances of getting a unique ID are decreased because if the system loses power the date/time resets (on the Xbox anyway, don't know about the 360).

Try something like: 0xFFFFSMHDYYYYRRRR

TimeInSecsSinceBoot:Second:Minute:Hour:Day:Year:Random

and maybe throw in some XORS or something if needed. Time in secs since boot is probably the same function in the 360 SDK as it was in the Xbox SDK.

Share this post


Link to post
Share on other sites
Maybe RFC 4122 will give you some information about how to implement GUIDs. It even has a sample implementation at the end, which you could use.

If people come up with their own non-standard algorithms, there is a greater chance of collisions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!