From 1dd823fa5e3fbb2b64990f65deab7239689ea73d Mon Sep 17 00:00:00 2001 From: Aaron Trevena Date: Fri, 8 Jul 2005 19:11:54 +0000 Subject: [PATCH] added Session.pm git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@349 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole/Session.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/Maypole/Session.pm 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; -- 2.39.2