line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Session::ID::md5; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: md5.pm 216 2005-09-01 10:52:26Z sherzodr $ |
4
|
|
|
|
|
|
|
|
5
|
13
|
|
|
13
|
|
60
|
use strict; |
|
13
|
|
|
|
|
17
|
|
|
13
|
|
|
|
|
504
|
|
6
|
13
|
|
|
13
|
|
59
|
use Digest::MD5; |
|
13
|
|
|
|
|
19
|
|
|
13
|
|
|
|
|
378
|
|
7
|
13
|
|
|
13
|
|
59
|
use CGI::Session::ErrorHandler; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
1342
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$CGI::Session::ID::md5::VERSION = '1.4'; |
10
|
|
|
|
|
|
|
@CGI::Session::ID::md5::ISA = qw( CGI::Session::ErrorHandler ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
*generate = \&generate_id; |
13
|
|
|
|
|
|
|
sub generate_id { |
14
|
16
|
|
|
16
|
0
|
112
|
my $md5 = new Digest::MD5(); |
15
|
16
|
|
|
|
|
751
|
$md5->add($$ , time() , rand(time) ); |
16
|
16
|
|
|
|
|
164
|
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 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |