[Q]:Generate Unique ID's

Tim Lesher tim at lesher.ws
Mon May 26 20:05:28 EDT 2003


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote in message news:<7xn0hdguox.fsf at ruckus.brouhaha.com>...
> Joe Francia <usenet at soraia.com> writes:
> > There's a CreateGuid() funtion in the pywintypes modules, which is
> > part of the ActiveState python distribution (which includes the Win32
> > Extensions):
> 
> I don't think you can rely on that function to create vast quantities
> of unique ID's, e.g. one for each row of a billion-row database.
> Usually those Windows guids are partly constant (based on MAC address).
> They also can be a privacy leak in some situations, because they reveal
> the MAC address.  So I think it's better to use a random number.

Actually, they're no longer based on MAC addresses; they haven't been
for several iterations of the OS.  They're now based on a much better,
entropy-based PRNG (the same one on which the Windows crypto subsystem
is based), so if you're using a PRNG to generate GUIDs, you're
essentially doing the same thing.

-- 
Tim Lesher
tim at lesher.ws




More information about the Python-list mailing list