Platform-independent GUID creation?

Mats Wichmann mats at laplaza.org
Sun Jan 6 11:31:27 EST 2002


On 22 Dec 2001 07:42:32 -0800, aahz at panix.com (Aahz Maruch) wrote:

:In article <a01vup$p52$1 at news1.xs4all.nl>,
:Irmen de Jong <usenet at NOSPAM-irmen.cjb.net> wrote:
:>Aahz wrote:
:>> 
:>> The problem is that the DCE/OSF GUID standard specifies using the MAC
:>> address of the network card as part of a GUID.  There isn't a portable
:>> way to get that, unfortunately.
:>
:>I've crafted my own Guid function, and it is used heavily in Pyro
:>(pyro.sourceforge.net).  It uses the machine's IP address instead of
:>the MAC address, and adds the Pid and some other stuff (timestamp,
:>random number).
:>
:>I don't know the DCE standard, but I do think that my routine is
:>fairly "safe", so to speak.  At least it is portable across all Python
:>implementations, but the machine needs to have an IP address. A
:>physical MAC address is not requiered, so it should work nicely on
:>modem-only machines.
:
:Nice try.  (That's partly serious, partly sarcasm.)  It probably works
:for limited applications, but it's definitely not a guaranteed GUID.
:One of the big problems with your method is that the widespread adoption
:of NAT combined with excessive use of "private" IP addresses means that
:there's a lot of IP address duplication out there.

Plus there are classes of machines that don't /have/ an IP address if
there's something wrong with their connection to the world.  DHCP
comes to mind (sever down?), but I've also seen implementations that
just plain don't initialize the interface (and thus appear to have no
address) if the cable's unplugged.

Mats Wichmann




More information about the Python-list mailing list