line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Session::ID::MD5_Base64; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# $Id: MD5_Base64.pm_rev 1.3 2003/12/11 16:32:43 root Exp root $ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
54422
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
46
|
|
6
|
1
|
|
|
1
|
|
5
|
use Digest::MD5; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
7
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
192
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '1.01'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub generate_id { |
13
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
14
|
0
|
|
|
|
|
|
my $md5 = new Digest::MD5(); |
15
|
0
|
|
|
|
|
|
$md5->add( $$ , time() , rand(9999) ); |
16
|
0
|
|
|
|
|
|
return $md5->b64digest(); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=pod |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
CGI::Session::ID::MD5_Base64 - CGI::Session ID driver based on Base64 encoding |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use CGI::Session; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$session = new CGI::Session("id:MD5_Base64", undef, { Directory => '/tmp' }; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 DESCRIPTION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
CGI::Session::ID::MD5_Base64 is to generate MD5 digest Base64 encoded random ids. |
37
|
|
|
|
|
|
|
The library does not require any arguments. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 COPYRIGHT |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Copyright (C) 2003 Daniel Peder. All rights reserved. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This library is free software. You can modify and distribute it under the same terms as Perl itself. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Partialy based on CGI::Session::ID::MD5 and the whole excelent CGI::Session work by |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Sherzod Ruzmetov |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 AUTHOR |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Daniel Peder |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Feedbacks, suggestions and patches are welcome. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SEE ALSO |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=over 4 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item * |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
L - Base64 encoding method |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
L - Auto Incremental ID generator |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L - CGI::Session manual |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L - extended CGI::Session manual |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
L - practical solutions for real life problems |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
B - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L - standard CGI library |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L - another fine alternative to CGI::Session |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=back |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |