line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Jorge::Plugin::Md5; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
822
|
use Digest::MD5; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @EXPORT); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
7
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
59
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
@EXPORT = qw( |
10
|
|
|
|
|
|
|
encodeMd5 |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Jorge::Plugin::Md5 - Sample plugin to provide Md5 encoding of Jorge Params |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Version 0.01 |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub import { |
26
|
1
|
|
|
1
|
|
7
|
my $pkg = shift; |
27
|
1
|
|
|
|
|
2
|
my $callpkg = caller; |
28
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
175
|
|
29
|
1
|
|
|
|
|
2
|
foreach my $sym (@EXPORT) { |
30
|
1
|
|
|
|
|
1
|
*{"${callpkg}::$sym"} = \&{$sym}; |
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
2
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub encodeMd5 { |
35
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
my @params = @_; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $md5 = Digest::MD5->new; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
foreach my $key (@params) { |
41
|
0
|
|
|
|
|
|
my $k = $self->{$key}; |
42
|
0
|
|
|
|
|
|
$md5->add($k); |
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
return substr( $md5->hexdigest, 0, 8 ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 SYNOPSIS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Imports the function encodeMd5 into Jorge::DBEntity namespace. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHORS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Mondongo, C<< >> Did the important job and started |
54
|
|
|
|
|
|
|
this beauty. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Julian Porta, C<< >> took the code and tried |
57
|
|
|
|
|
|
|
to make it harder, better, faster, stronger. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 BUGS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, |
62
|
|
|
|
|
|
|
or through the web interface at |
63
|
|
|
|
|
|
|
L. |
64
|
|
|
|
|
|
|
I will be notified, and then you'll |
65
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SUPPORT |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
perldoc Jorge |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
You can also look for information at: |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=over 4 |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * Github Project Page |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item * CPAN Ratings |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
L |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item * Search CPAN |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=back |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Mondongo C<< >> For starting this. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Copyright 2009 Julian Porta, all rights reserved. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
111
|
|
|
|
|
|
|
under the same terms as Perl itself. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=cut |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; # End of Jorge::::DB |
117
|
|
|
|
|
|
|
|