blib/lib/Digest/Haval256.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 3 / 3 totaltotal 87.8% 36 / 41 CC 4 SCAR 9.1
CC
4
Cov
88%
addfile
4.1
base64digest
2.0
BEGIN
1.0
CRAP 2.5
↑ Summary _haval.c »
1 package Digest::Haval256;
2  
3 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 require Exporter;
7  
8 13 our @EXPORT_OK = qw(new hashsize rounds reset add addfile digest hexdigest base64digest);
9 13 our $VERSION = '1.0.5';
10 13 our @ISA = qw(Exporter);
11  
12 13 require XSLoader;
13 13 XSLoader::load('Digest::Haval256', $VERSION);
14  
15 # Preloaded methods go here.
16  
17 sub addfile
18 6 ▶{
Subroutine addfile: called CC=4 SCAR=14.0
Pod documented
19 6 my ($self, $handle) = @_;
20 6 my ($package, $file, $line) = caller;
21  
22 6 ▶ if (!ref($handle)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $handle) 6 0 6
23 6 ▶ $handle = "$package::$handle" unless ($handle =~ /(\:\:|\')/);
Branch: 1 branch
BranchTrueFalseTotal
unless $handle =~ /(\:\:|\')/ 0 6 6
24 }
25  
26 6 ▶ while (read($handle, my $data, 1048576)) {
Branch: 1 branch
BranchTrueFalseTotal
if (read $handle, my $data, 1048576) 5 6 11
27 5 $self->add($data);
28 }
29 }
30  
31 sub hexdigest
32 12 ▶{
Subroutine hexdigest: called CC=1 SCAR=0.0
Pod documented
33 12 my $self = shift;
34 12 return unpack("H*", $self->digest());
35 }
36  
37 sub base64digest
38 0 ▶{
Subroutine base64digest: not called CC=1 SCAR=6.9
Pod documented
39 0 my $self = shift;
40 0 return encode_base64($self->digest(), "");
41 }
42  
43 13 1;
44  
45 __END__
↑ Summary _haval.c »