Filename | /usr/share/perl5/CGI/Session/ID/md5.pm |
Statements | Executed 10 statements in 189µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 15µs | 22µs | BEGIN@5 | CGI::Session::ID::md5::
1 | 1 | 1 | 14µs | 33µs | BEGIN@6 | CGI::Session::ID::md5::
1 | 1 | 1 | 5µs | 5µs | BEGIN@7 | CGI::Session::ID::md5::
0 | 0 | 0 | 0s | 0s | generate_id | CGI::Session::ID::md5::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package CGI::Session::ID::md5; | ||||
2 | |||||
3 | # $Id$ | ||||
4 | |||||
5 | 2 | 38µs | 2 | 29µs | # spent 22µs (15+7) within CGI::Session::ID::md5::BEGIN@5 which was called:
# once (15µs+7µs) by CGI::Session::_load_pluggables at line 5 # spent 22µs making 1 call to CGI::Session::ID::md5::BEGIN@5
# spent 7µs making 1 call to strict::import |
6 | 2 | 50µs | 2 | 52µs | # spent 33µs (14+19) within CGI::Session::ID::md5::BEGIN@6 which was called:
# once (14µs+19µs) by CGI::Session::_load_pluggables at line 6 # spent 33µs making 1 call to CGI::Session::ID::md5::BEGIN@6
# spent 19µs making 1 call to Exporter::import |
7 | 2 | 89µs | 1 | 5µs | # spent 5µs within CGI::Session::ID::md5::BEGIN@7 which was called:
# once (5µs+0s) by CGI::Session::_load_pluggables at line 7 # spent 5µs making 1 call to CGI::Session::ID::md5::BEGIN@7 |
8 | |||||
9 | 1 | 500ns | $CGI::Session::ID::md5::VERSION = '4.43'; | ||
10 | 1 | 6µs | @CGI::Session::ID::md5::ISA = qw( CGI::Session::ErrorHandler ); | ||
11 | |||||
12 | 1 | 1µs | *generate = \&generate_id; | ||
13 | sub generate_id { | ||||
14 | my $md5 = Digest::MD5->new(); | ||||
15 | $md5->add($$ , time() , rand(time) ); | ||||
16 | return $md5->hexdigest(); | ||||
17 | } | ||||
18 | |||||
19 | |||||
20 | 1 | 4µs | 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 = CGI::Session->new("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 |