~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/CPAN/lib/CGI/Session/ID/md5.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package CGI::Session::ID::md5;
 
2
 
 
3
# $Id: md5.pm 420 2008-07-08 01:23:06Z markstos $
 
4
 
 
5
use strict;
 
6
use Digest::MD5;
 
7
use CGI::Session::ErrorHandler;
 
8
 
 
9
$CGI::Session::ID::md5::VERSION = '4.33';
 
10
@CGI::Session::ID::md5::ISA     = qw( CGI::Session::ErrorHandler );
 
11
 
 
12
*generate = \&generate_id;
 
13
sub generate_id {
 
14
    my $md5 = new Digest::MD5();
 
15
    $md5->add($$ , time() , rand(time) );
 
16
    return $md5->hexdigest();
 
17
}
 
18
 
 
19
 
 
20
1;
 
21
 
 
22
=pod
 
23
 
 
24
=head1 NAME
 
25
 
 
26
CGI::Session::ID::md5 - default CGI::Session ID generator
 
27
 
 
28
=head1 SYNOPSIS
 
29
 
 
30
    use CGI::Session;
 
31
    $s = new CGI::Session("id:md5", undef);
 
32
 
 
33
=head1 DESCRIPTION
 
34
 
 
35
CGI::Session::ID::MD5 is to generate MD5 encoded hexadecimal random ids. The library does not require any arguments. 
 
36
 
 
37
=head1 LICENSING
 
38
 
 
39
For support and licensing see L<CGI::Session|CGI::Session>
 
40
 
 
41
=cut