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.04'; # VERSION
3             our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
4              
5 1     1   458 use strict;
  1         2  
  1         29  
6 1     1   4 use Digest::MD5 qw(md5);
  1         2  
  1         58  
7 1     1   373 use Digest::HMAC qw(hmac);
  1         2  
  1         44  
8              
9             # OO interface
10 1     1   5 use vars qw(@ISA);
  1         1  
  1         76  
11             @ISA=qw(Digest::HMAC);
12             sub new
13             {
14 7     7 0 2671 my $class = shift;
15 7         19 $class->SUPER::new($_[0], "Digest::MD5", 64);
16             }
17              
18             # Functional interface
19             require Exporter;
20             *import = \&Exporter::import;
21 1     1   5 use vars qw(@EXPORT_OK);
  1         1  
  1         129  
22             @EXPORT_OK=qw(hmac_md5 hmac_md5_hex);
23              
24             sub hmac_md5
25             {
26 7     7 0 27 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__