File Coverage

blib/lib/Digest/HMAC_MD5.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 21 26 80.7


line stmt bran cond sub pod time code
1             package Digest::HMAC_MD5;
2             our $VERSION = '1.05'; # VERSION
3             our $AUTHORITY = 'cpan:ARODLAND'; # AUTHORITY
4              
5 1     1   7149 use strict;
  1         2  
  1         53  
6 1     1   9 use Digest::MD5 qw(md5);
  1         3  
  1         104  
7 1     1   686 use Digest::HMAC qw(hmac);
  1         3  
  1         182  
8              
9             # OO interface
10             our @ISA=qw(Digest::HMAC);
11             sub new
12             {
13 7     7 0 213300 my $class = shift;
14 7         21 $class->SUPER::new($_[0], "Digest::MD5", 64);
15             }
16              
17             # Functional interface
18             require Exporter;
19             *import = \&Exporter::import;
20 1     1   8 use vars qw(@EXPORT_OK);
  1         2  
  1         167  
21             @EXPORT_OK=qw(hmac_md5 hmac_md5_hex);
22              
23             sub hmac_md5
24             {
25 7     7 0 23 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__