Platform-independent GUID creation?

Aahz Maruch aahz at panix.com
Fri Dec 21 18:07:04 EST 2001


In article <789798cc.0112211457.10505b9c at posting.google.com>,
Jeff Koftinoff <jeff at jdkoftinoff.com> wrote:
>"Steve Holden" <sholden at holdenweb.com> wrote in message news:<ZdKU7.34158$pc4.4356 at atlpnn01.usenetserver.com>...
>>
>> Whatever. I'll settle for a Unix "create GUID" routine and one
>> for the Mac (I would assume for these purposes that OSX shold be
>> treated like some flavor of U*ix?). These could be included along
>> with the win32 CreateGuid() and a platform choice to give something
>> *reasonably* portable.
>
>The problem of course with creating a GUID this way is that it REQUIRES
>the computer to have an ethernet adapter.
>
>I got bitten by this one before when some clients only had modems, and
>my app needed to create a GUID on their computer.

Close, but not quite.  The standard does specify a mechanism for
creating GUIDs with computers that don't have network adapters, but it
specifically doesn't guarantee that they will be truly unique.  If your
system was closed, you could assign each client a unique base for
generating GUIDs.

Better, though (particularly if there's any chance your system will need
to interoperate with others (or if there's a mixture of clients)), would
be to generate GUIDs on the server and download batches to the clients.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

Tenth Virtual Anniversary: 10 days and counting



More information about the Python-list mailing list