line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Digest::MD5; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
253277
|
use strict; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
252
|
|
4
|
6
|
|
|
6
|
|
33
|
use warnings; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
410
|
|
5
|
6
|
|
|
6
|
|
33
|
use vars qw($VERSION); |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
436
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$VERSION = 0.04; |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
31
|
use base qw(Template::Plugin); |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
5786
|
|
10
|
6
|
|
|
6
|
|
944424
|
use Template::Plugin; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
146
|
|
11
|
6
|
|
|
6
|
|
406613
|
use Template::Stash; |
|
6
|
|
|
|
|
266468
|
|
|
6
|
|
|
|
|
224
|
|
12
|
6
|
|
|
6
|
|
105
|
use Digest::MD5 qw(md5 md5_hex md5_base64); |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
2150
|
|
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
|
21649
|
my ($class, $context, $options) = @_; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# now define the filter and return the plugin |
22
|
6
|
|
|
|
|
29
|
$context->define_filter('md5', \&_md5); |
23
|
6
|
|
|
|
|
124
|
$context->define_filter('md5_hex', \&_md5_hex); |
24
|
6
|
|
|
|
|
91
|
$context->define_filter('md5_base64', \&_md5_base64); |
25
|
6
|
|
|
|
|
95
|
return bless {}, $class; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _md5 { |
29
|
4
|
50
|
|
4
|
|
13713
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
30
|
4
|
|
|
|
|
40
|
return md5(join('', @_)); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _md5_hex { |
34
|
7
|
50
|
|
7
|
|
199
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
35
|
7
|
|
|
|
|
57
|
return md5_hex(join('', @_)); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _md5_base64 { |
39
|
3
|
50
|
|
3
|
|
143
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
40
|
3
|
|
|
|
|
36
|
return md5_base64(join('', @_)); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |