unique number generator
Harry George
harry.g.george at boeing.com
Wed May 19 11:21:20 EDT 2004
Daniel 'Dang' Griffith <noemail at noemail4u.com> writes:
> On Wed, 19 May 2004 18:36:40 +0800, "Joe Wong" <joewong at mango.cc>
> wrote:
>
> > I need to implement a unique number generator that 1 or more processes on same or different machines will make use of it. Is there any library / project available already for this?
>
> Yes. Google for GUID (globally unique identifier) algorithm or UUID
> (universally unique algorithm):
> "http://www.google.com/search?q=GUID+algorithm",
> "http://www.google.com/search?q=UUID+algorithm".
>
> If you need to use one, instead of implement one, and
> you're running on Windows machines with Mark Hammond's
> win32 extensions, you can do it easily:
>
> import pywintypes
> guid = pywintypes.CreateGuid()
> have_a_nice_day(guid)
>
> --dang
Pyro.util.getGUID() is a cross-platform solution. Or, you can write a
wrapper which uses MS's guid on Win** platforms, and Pyro's on *NIX
platforms.
--
harry.g.george at boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 342-0007
More information about the Python-list
mailing list