]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Session.pm
added Session.pm
[maypole.git] / lib / Maypole / Session.pm
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;