line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Digest::SHA2; |
2
|
|
|
|
|
|
|
|
3
|
21
|
|
|
21
|
|
6542173
|
use base 'Digest::base'; |
|
21
|
|
|
|
|
61
|
|
|
21
|
|
|
|
|
2851
|
|
4
|
21
|
|
|
21
|
|
122
|
use strict; |
|
21
|
|
|
|
|
44
|
|
|
21
|
|
|
|
|
781
|
|
5
|
21
|
|
|
21
|
|
113
|
use warnings; |
|
21
|
|
|
|
|
49
|
|
|
21
|
|
|
|
|
6090
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# addfile() and b64digest() already implemented by Digest::base |
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw(new hashsize rounds clone reset add digest hexdigest base64digest); |
10
|
|
|
|
|
|
|
our @EXPORT = qw(); |
11
|
|
|
|
|
|
|
our $VERSION = '1.1.1'; |
12
|
|
|
|
|
|
|
#our @ISA = qw(Exporter); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require XSLoader; |
15
|
|
|
|
|
|
|
XSLoader::load('Digest::SHA2', $VERSION); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Preloaded methods go here. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#sub addfile |
20
|
|
|
|
|
|
|
#{ |
21
|
|
|
|
|
|
|
# my ($self, $handle) = @_; |
22
|
|
|
|
|
|
|
# my ($package, $file, $line) = caller; |
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
# if (!ref($handle)) { |
25
|
|
|
|
|
|
|
# $handle = "$package::$handle" unless ($handle =~ /(\:\:|\')/); |
26
|
|
|
|
|
|
|
# } |
27
|
|
|
|
|
|
|
# |
28
|
|
|
|
|
|
|
# while (read($handle, my $data, 4*1024)) { |
29
|
|
|
|
|
|
|
# $self->add($data); |
30
|
|
|
|
|
|
|
# } |
31
|
|
|
|
|
|
|
#} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub digest |
34
|
|
|
|
|
|
|
{ |
35
|
4
|
|
|
4
|
1
|
8545
|
my ($self) = @_; |
36
|
4
|
|
|
|
|
126
|
return pack("H*", $self->hexdigest()); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub base64digest # legacy |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
1
|
|
print STDERR "\nWARNING: base64digest() is now deprecated, and "; |
42
|
0
|
|
|
|
|
|
print STDERR "will be removed in future\n"; |
43
|
0
|
|
|
|
|
|
print STDERR "releases; please use b64digest() instead.\n\n"; |
44
|
0
|
|
|
|
|
|
return shift->b64digest(@_); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |