For a really nice "unique" id, I like Jeffrey Baker's APache::Session hash
function which uses a load of random stuff mungled together. You might want
to snag that out of the code.
His routine doesnt work too well on a select few platforms (eg Win98 + ISAPI
Perl), but it works great on Apache mod_perl.
One thing to note: MD5 hashes DO have a possibility of being having a hash
collision. Granted, it's unlikely, but it is POSSIBLE. Therefore, you should
probably still keep track of what ids had been generated previously. I guess
it depends on what you want to do.
Matt Sergeant wrote:
> On Thu, 17 Feb 2000, you wrote:
> > hi,
> >
> > I'm looking to generate a unique id, probably 128bits. Any suggestions
> > on how to do this with mod_perl/apache?
>
> MD5 of rand and %ENV ?
>
> --
> <Matt/>
>
> Details: FastNet Software Ltd - XML, Perl, Databases.
> Tagline: High Performance Web Solutions
> Web Sites: http://come.to/fastnet http://sergeant.org
> Available for Consultancy, Contracts and Training.