LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2004, 05:41 AM   #1
sikil_nuru
LQ Newbie
 
Registered: Jun 2003
Location: Sweden
Distribution: SuSe 9.0
Posts: 13

Rep: Reputation: 0
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?
 
Old 03-13-2004, 06:04 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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.

Last edited by Hko; 03-13-2004 at 06:07 PM.
 
Old 03-14-2004, 07:43 AM   #3
sikil_nuru
LQ Newbie
 
Registered: Jun 2003
Location: Sweden
Distribution: SuSe 9.0
Posts: 13

Original Poster
Rep: Reputation: 0
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?
 
Old 03-14-2004, 08:17 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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.
 
Old 03-14-2004, 09:17 AM   #5
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
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

Last edited by deiussum; 03-14-2004 at 09:21 AM.
 
Old 03-16-2004, 03:22 PM   #6
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Does this help?

man uuidgen
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
guids and suids hongman Linux - Newbie 2 03-21-2005 04:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration