[Zope-CMF] CMFUid isn't generating real uids

Jean-Marc Orliaguet jmo at ita.chalmers.se
Sun Aug 15 05:46:01 EDT 2004


Christian Heimes wrote:

> Hello everybody!
>
> I had a short look at CMFUid because I hoped we could replace the AT 
> uid generator and lookup tool with a more general tool that's also 
> working with non Archtypes types. I was disapointed to shocked as I 
> saw how the uids are generated.
>
> It's just an incremental counter which is more likely a very 
> simplistic id generator but not a real uid generator. It's not likely 
> that other portals are using the same uid, it's a FACT because every 
> portal is starting the with id 0. IMO that's not unique.
> In Archetypes we are also including informations about the machine in 
> the uid to create uuid (universal unique ids). The uuid is created 
> from the local host name, a time stamp, a random value and from 
> abitrary arguments and the output of md5.md5(data).hexdigest() is used 
> as uid. This makes it mathematical nearly impossible to have one uid 
> twice over all cmf based sites on earth.
>
> A good uid should follow these rules (from the manual of uuidgen)
> DESCRIPTION
>        The  uuidgen  program  creates  a  new universally unique
>        identifier (UUID)
>        using the libuuid(3) library.  The new UUID can  reasonably  be
>        considered
>        unique among all UUIDs created on the local system, and among
>        UUIDs created
>        on other systems in the past and in the future
>
> Christian
>
The goal might be different here,
There is a need for such a type of generator that creates short IDs, 
that are not 50 character long and that translate into human-friendly URLs.

do you mean that AT will assume a priori  that the generated ID is 100% 
unique?   What happens when you create 500 documents with unique IDs 
inside a folder, export the folder as a  .zexp archive and import it on 
another server? Will Zope take care of renaming all the ids according to 
the name of the new machine? What happens when you do a copy and paste? 
The idea is not simply to generate unique IDs but also to keep them 
unique. Uniqueness is not a quality that something has in itself it is 
always in relation to something else and "mathematically nearly 
impossible" is a contradiction in itself, you probably meant 
"statistically"?

Regards /JM



More information about the Zope-CMF mailing list