File Coverage

blib/lib/Digest/HMAC_MD5.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 3 0.0
total 25 30 83.3


line stmt bran cond sub pod time code
1             package Digest::HMAC_MD5;
2             our $VERSION = '1.03_01'; # TRIAL VERSION
3             our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
4              
5 1     1   436 use strict;
  1         2  
  1         33  
6 1     1   5 use Digest::MD5 qw(md5);
  1         2  
  1         67  
7 1     1   482 use Digest::HMAC qw(hmac);
  1         2  
  1         53  
8              
9             # OO interface
10 1     1   6 use vars qw(@ISA);
  1         2  
  1         90  
11             @ISA=qw(Digest::HMAC);
12             sub new
13             {
14 7     7 0 3266 my $class = shift;
15 7         24 $class->SUPER::new($_[0], "Digest::MD5", 64);
16             }
17              
18             # Functional interface
19             require Exporter;
20             *import = \&Exporter::import;
21 1     1   6 use vars qw(@EXPORT_OK);
  1         2  
  1         135  
22             @EXPORT_OK=qw(hmac_md5 hmac_md5_hex);
23              
24             sub hmac_md5
25             {
26 7     7 0 32 hmac($_[0], $_[1], \&md5, 64);
27             }
28              
29             sub hmac_md5_hex
30             {
31 0     0 0   unpack("H*", &hmac_md5)
32             }
33              
34             1;
35              
36             __END__