Re: [ROOT] any class generating unique ID ?

From: Brett Viren (bv@bnl.gov)
Date: Tue Mar 05 2002 - 16:39:12 MET


Joe Robe writes:
 > Hi Rooters,
 > 
 > is there any class in root which generates an unique ID, like the windoze CLASSID generator ??
 > 
 > If not, any idea how I can create an Int_t which is really unique ?

You might want to take a look at "uuidgen" which comes with e2fsprogs
package (e2fs = Linux's ext2 filesystem).  It claims:

       The uuidgen program creates a new universally unique iden­
       tifier (UUID) using the libuuid(3) library.  The new  UUID
       can  reasonably  be considered unique among all UUIDs cre­
       ated on the local system, and among UUIDs created on other
       systems in the past and in the future.

       There  are two types of UUID's which uuidgen can generate:
       time-based UUID's and  random-based  UUID's.   By  default
       uuidgen  will generate a random-based UUID if a high-qual­
       ity random number generator  is  present.   Otherwise,  it
       will chose a time-based UUID. 

Note the use of "reasonably".  But, depending on what you actually
want the UUID for, it may be enough.

-Brett.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:44 MET