GUIDs
How do i create Globally Unique IDentifiers?
Ei a number that will never be generated on another machine ever again. Doesn't it involve using the CPU-ID? |
In what programming language?
You could use tha MAC address(es), if the computer has a network card, an if that's strong enough for you as an identifier. |
C++ and/or assembler. Im writing a 3D-engine in wich the users can
create ther own mods/levels/what-ever and instead of using the name of the plugin like Unreal and Quake does wich causes name collisions (how do i know that a guy on the other side of the planet isn't using this name?). No i can't use MAC-addresses cause i want my engine to run even if the computer isn't network-connected :( . I know that with DirectX (i tried it, but prefer OpenGL) comes a program that generats GUIDs, how does it work? |
The only thing I could think of is using as much as possible system specific information from /proc. You could make one string of all info concatenated, and maybe generate an MD5 sum from it.
|
If you are talking about the MS GUID generator, it works by using a combination of MAC address, timestamp, and a random number. For computers without a MAC address, it uses an alternate method. In Windows, there are various libraries that can be used to generate a GUID. I don't know of any libraries offhand that do so for Linux, but if you search around, you may be able to find something.
Here's a link to the code for Microsoft's GUIDGEN app. I haven't looked at it at all, so it maybe just calls their APIs to get the GUID, which probably wouldn't be much help to you. http://msdn.microsoft.com/library/de...fc_guidgen.asp |
Does this help?
man uuidgen |
All times are GMT -5. The time now is 05:38 AM. |