in reply to Re: MD5-based Unique Session ID Generator
in thread MD5-based Unique Session ID Generator

Data::UUID guarantees that you won't get duplicates, ever.

While Data::UUID is a good solution, it doesn't guarantee that "you won't get duplicates, ever" (heck - there are only 128bits after all :-)

As the docs say...

A UUID is 128 bits long, and is guaranteed to be different from all other UUIDs/GUIDs generated until 3400 CE.

...

It provides reasonably efficient and reliable framework for generating UUIDs and supports fairly high allocation rates -- 10 million per second per machine -- and therefore is suitable for identifying both extremely short-lived and very persistent objects on a given system as well as across the network.

So, it wouldn't be suitable if you were coding something up for The Long Foundation - or needed to allocate UUIDs really, really, really quickly :-)

The full gory detail can be found in this IETF draft.

All this complexity is, of course, why I like Data::UUID. People who are experts have taken the time to look hard at the algorithm, and I can have some confidence in it working well.

  • Comment on Re^2: MD5-based Unique Session ID Generator

Replies are listed 'Best First'.
Re^3: MD5-based Unique Session ID Generator
by simonm (Vicar) on Aug 21, 2004 at 16:22 UTC
    While Data::UUID is a good solution, it doesn't guarantee that "you won't get duplicates, ever" (heck - there are only 128bits after all :-) ... A UUID is 128 bits long, and is guaranteed to be different from all other UUIDs/GUIDs generated until 3400 CE.

    I didn't say "it will never produce duplicates" -- just that "YOU won't get duplicates" (unless you live for over a thousand years).

      I didn't say "it will never produce duplicates" -- just that "YOU won't get duplicates" (unless you live for over a thousand years)

      You mean you're not planning to?

      I fully intend to be scanned and on CPAN as JAPH::ADIE when the singularity hits (probably initiated by the release of Perl 6 into the wild :-)