line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Digest::MD5; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
121185
|
use strict; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
210
|
|
4
|
6
|
|
|
6
|
|
26
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
184
|
|
5
|
6
|
|
|
6
|
|
80
|
use vars qw($VERSION); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
354
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$VERSION = 0.05; |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
29
|
use base qw(Template::Plugin); |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
3422
|
|
10
|
6
|
|
|
6
|
|
21126
|
use Template::Plugin; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
130
|
|
11
|
6
|
|
|
6
|
|
3089
|
use Template::Stash; |
|
6
|
|
|
|
|
66928
|
|
|
6
|
|
|
|
|
191
|
|
12
|
6
|
|
|
6
|
|
63
|
use Digest::MD5 qw(md5 md5_hex md5_base64); |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
1414
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'md5'} = \&_md5; |
15
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'md5_hex'} = \&_md5_hex; |
16
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'md5_base64'} = \&_md5_base64; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
6
|
|
|
6
|
1
|
14755
|
my ($class, $context, $options) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# now define the filter and return the plugin |
22
|
6
|
|
|
|
|
24
|
$context->define_filter('md5', \&_md5); |
23
|
6
|
|
|
|
|
98
|
$context->define_filter('md5_hex', \&_md5_hex); |
24
|
6
|
|
|
|
|
63
|
$context->define_filter('md5_base64', \&_md5_base64); |
25
|
6
|
|
|
|
|
70
|
return bless {}, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _md5 { |
29
|
4
|
50
|
|
4
|
|
7575
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
30
|
4
|
|
|
|
|
41
|
return md5(join('', @_)); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _md5_hex { |
34
|
7
|
50
|
|
7
|
|
151
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
35
|
7
|
|
|
|
|
50
|
return md5_hex(join('', @_)); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _md5_base64 { |
39
|
3
|
50
|
|
3
|
|
133
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
40
|
3
|
|
|
|
|
27
|
return md5_base64(join('', @_)); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |