Generating unique numbers?

VanL news at lindbergs.org
Sat Jun 1 18:53:48 CEST 2002


Hi,

I appreciate the various answers which have been proffered. 
  My application is thus:

I am writing an outliner.

TANGENT: Yes, I am aware of several other python outliner 
projects.  While each is good for various things, 1. none so 
far have the exact featureset that I want/need and 2. I 
thought it would be fun to try to write a GUI application. 
I have written several 1000+ line scripts, but those were in 
a completely different problem domain.
END TANGENT

I am using these IDs as keys to various nodes, all held 
within a B-Tree (I to O Btree) that is contained within a 
standalone ZODB.

The reason why I am wanting keys that are more likely to be 
globally unique is because I will be building in hooks to 
make this outliner network transparent (using ZEO), making 
it possible for multiple outliners to be used together as a 
real-time collaborative tool.  I want to be able to be able 
to have people merge stuctures that people have made in the 
standalone instance into a shared instance without tromping 
on another nodes data.

Based on what people have said, I was thinking of using some 
combination of DateTime.gmticks and the id of the obj, 
making it (I think) extremely unlikely that there would be a 
collision.

Any comments on this, or the project in general would be 
appreciated.

Thanks,

VanL




More information about the Python-list mailing list