unique number generator

Joe Wong joewong at mango.cc
Wed May 19 10:30:20 EDT 2004


Hi,

There is a constraint that the number can be at most 8 digits, ie:

00000000 ~ 99999999

No hex decimal is allowed...

And I am on Linux platform..

Any other suggestion? :-)


----- Original Message ----- 
From: "Daniel 'Dang' Griffith" <noemail at noemail4u.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, May 19, 2004 9:06 PM
Subject: Re: unique number generator


> 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
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list