Generating unique numbers?
holger krekel
pyth at devel.trillke.net
Sat Jun 1 13:34:02 EDT 2002
Aahz wrote:
> In article <3CF8FC1C.7060903 at lindbergs.org>, VanL <news at lindbergs.org> wrote:
> >
> >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.
>
> id() is very, very bad for any kind of persistent ID; I still think it's
> at least very bad even if you add in any kind of time.
>
> No, if you want to trade IDs across a network, you need GUIDs (DCE
> UUIDs). There's just no way around that. It's not the most perfect
> system in the world, but it's better than any other generally available
> scheme.
do you know of a good implementation of DCE UUIDs in python and/or C?
holger
More information about the Python-list
mailing list