Platform-independent GUID creation?

Irmen de Jong usenet at NOSPAM-irmen.cjb.net
Sat Dec 22 13:41:26 EST 2001


"Aahz Maruch" <aahz at panix.com> wrote in message
news:a029l8$ctn$1 at panix3.panix.com...

> 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.

Yes, I realised that. But it had to be portable. So I took the IP address,
the process ID and a random number.
There's no guarantee here (certainly not!) that the number is unique, but
the chances are pretty slim that you get an identical number.

I don't have a better solution. If anybody has a better (Pythonic) GUID
generator, I'd be very interested.

Regards
Irmen de Jong






More information about the Python-list mailing list