Portable UUID/GUID generation?

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

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-guids-01.txt

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