line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Digest::Haval256; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
3507287
|
use strict; |
|
13
|
|
|
|
|
33
|
|
|
13
|
|
|
|
|
555
|
|
4
|
13
|
|
|
13
|
|
74
|
use warnings; |
|
13
|
|
|
|
|
29
|
|
|
13
|
|
|
|
|
405
|
|
5
|
13
|
|
|
13
|
|
17418
|
use MIME::Base64; |
|
13
|
|
|
|
|
11897
|
|
|
13
|
|
|
|
|
4943
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw(new hashsize rounds reset add addfile digest hexdigest base64digest); |
9
|
|
|
|
|
|
|
our $VERSION = '1.0.5'; |
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
require XSLoader; |
13
|
|
|
|
|
|
|
XSLoader::load('Digest::Haval256', $VERSION); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Preloaded methods go here. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub addfile |
18
|
|
|
|
|
|
|
{ |
19
|
6
|
|
|
6
|
1
|
22785
|
my ($self, $handle) = @_; |
20
|
6
|
|
|
|
|
29
|
my ($package, $file, $line) = caller; |
21
|
|
|
|
|
|
|
|
22
|
6
|
50
|
|
|
|
35
|
if (!ref($handle)) { |
23
|
6
|
50
|
|
|
|
73
|
$handle = "$package::$handle" unless ($handle =~ /(\:\:|\')/); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
|
|
284
|
while (read($handle, my $data, 1048576)) { |
27
|
5
|
|
|
|
|
59
|
$self->add($data); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub hexdigest |
32
|
|
|
|
|
|
|
{ |
33
|
12
|
|
|
12
|
1
|
29588
|
my $self = shift; |
34
|
12
|
|
|
|
|
518
|
return unpack("H*", $self->digest()); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub base64digest |
38
|
|
|
|
|
|
|
{ |
39
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
40
|
0
|
|
|
|
|
|
return encode_base64($self->digest(), ""); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |