[ale] Perl random

Christopher Fowler cfowler at outpostsentinel.com
Fri Apr 16 08:35:09 EDT 2004


I want to create session ids to be stored as cookies for use in my PERL
CGI programs.  The IDs will be store in SQLlite with a key into a table
that lists all the name value pairs for that session.  What I want to do
is randomly generate a 64bit number and then convert it into a hex
string.  This string will be 128 characters long.  I will then set that
string as the session id in the cookie and insert it into the table.

What is the best way to generate the number and convert to hex?

Thanks,
Chris



More information about the Ale mailing list