in reply to Re: Need to Generate Unique String
in thread Need to Generate Unique String

$uniquish = time() . $$ . rand;

;-)

cheers

tachyon

Replies are listed 'Best First'.
Re^3: Need to Generate Unique String
by stvn (Monsignor) on Jul 29, 2004 at 18:15 UTC

    use Digest::MD5; $pretty_darn_close_to_unique = md5_hex(md5_hex(time() . $$ . rand . {} +));

    -stvn

      I love the subtle inclusion of a memory reference.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
        I love the subtle inclusion of a memory reference.

        I would love to take credit for that, but fact is I ripped it off from Apache::Session::Generate::MD5. Its a nice one, I have used it (the extracted code, not the module) for a while as a session id generator and it has worked out quite well.

        -stvn