[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

portable UUID/GUID generation?

David Garamond

11/25/2003 2:22:00 PM

Is there one? Haven't found anything suitable on RAA. I need to generate
GUID/UUID on Linux as well as Windows using the same algorithm (and
preferably without using an external library, except for fetching MAC
address).

--
dave





1 Answer

David Garamond

11/25/2003 8:23:00 PM

0

David Garamond wrote:
> Is there one? Haven't found anything suitable on RAA. I need to generate
> GUID/UUID on Linux as well as Windows using the same algorithm (and
> preferably without using an external library, except for fetching MAC
> address).

To change my question into another. I just finished writing a Uuid class
according to the algorithm explained in:

http://www.ics.uci.edu/~ejw/authoring/uuid-guid/draft-leach-uuids-gu...

but then I read Microsoft is no longer using GUID, but some random
number generator. Is it correct that as long as the MAC address is used
as one of the sources of the random seed, something like this is as
"unique" as the old UUID/GUID?

$ ruby -rmd5 -e'p MD5.new("some random string, incorporating timestamp,
MAC address, and some other random seeds")'

or

$ ruby -rsha1 -e'p SHA1.new("some random string, incorporating
timestamp, MAC address, and some other random seeds")'

and I can just as well feed the whole output of ifconfig or ipconfig
/all command.

--
dave