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             $VERSION="1.01";
3              
4 1     1   511 use strict;
  1         2  
  1         39  
5 1     1   5 use Digest::MD5 qw(md5);
  1         2  
  1         61  
6 1     1   544 use Digest::HMAC qw(hmac);
  1         2  
  1         51  
7              
8             # OO interface
9 1     1   4 use vars qw(@ISA);
  1         2  
  1         83  
10             @ISA=qw(Digest::HMAC);
11             sub new
12             {
13 7     7 0 3165 my $class = shift;
14 7         29 $class->SUPER::new($_[0], "Digest::MD5", 64);
15             }
16              
17             # Functional interface
18             require Exporter;
19             *import = \&Exporter::import;
20 1     1   5 use vars qw(@EXPORT_OK);
  1         2  
  1         117  
21             @EXPORT_OK=qw(hmac_md5 hmac_md5_hex);
22              
23             sub hmac_md5
24             {
25 7     7 0 48 hmac($_[0], $_[1], \&md5, 64);
26             }
27              
28             sub hmac_md5_hex
29             {
30 0     0 0   unpack("H*", &hmac_md5)
31             }
32              
33             1;
34              
35             __END__