From: Aaron Trevena Date: Fri, 8 Jul 2005 19:11:54 +0000 (+0000) Subject: added Session.pm X-Git-Tag: 2.10~15 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=1dd823fa5e3fbb2b64990f65deab7239689ea73d;p=maypole.git added Session.pm git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@349 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Session.pm b/lib/Maypole/Session.pm new file mode 100644 index 0000000..47f6879 --- /dev/null +++ b/lib/Maypole/Session.pm @@ -0,0 +1,12 @@ +package Maypole::Session; + +use strict; +use Digest::MD5; + +sub generate_unique_id { + my $length = shift || 32; + my $id = substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, $length); + return; +} + +1;