]> git.decadent.org.uk Git - maypole.git/commitdiff
added Session.pm
authorAaron Trevena <aaron.trevena@gmail.com>
Fri, 8 Jul 2005 19:11:54 +0000 (19:11 +0000)
committerAaron Trevena <aaron.trevena@gmail.com>
Fri, 8 Jul 2005 19:11:54 +0000 (19:11 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@349 48953598-375a-da11-a14b-00016c27c3ee

lib/Maypole/Session.pm [new file with mode: 0644]

diff --git a/lib/Maypole/Session.pm b/lib/Maypole/Session.pm
new file mode 100644 (file)
index 0000000..47f6879
--- /dev/null
@@ -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;