line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Digest::file; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
76120
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
24
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
4
|
use Exporter (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
14
|
|
7
|
1
|
|
|
1
|
|
4
|
use Carp qw(croak); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
8
|
1
|
|
|
1
|
|
383
|
use Digest (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
200
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = "1.20"; |
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw(digest_file_ctx digest_file digest_file_hex digest_file_base64); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub digest_file_ctx { |
15
|
4
|
|
|
4
|
0
|
8
|
my $file = shift; |
16
|
4
|
50
|
|
|
|
9
|
croak("No digest algorithm specified") unless @_; |
17
|
4
|
100
|
|
|
|
307
|
open( my $fh, "<", $file ) || croak("Can't open '$file': $!"); |
18
|
3
|
|
|
|
|
18
|
binmode($fh); |
19
|
3
|
|
|
|
|
21
|
my $ctx = Digest->new(@_); |
20
|
3
|
|
|
|
|
84
|
$ctx->addfile($fh); |
21
|
3
|
|
|
|
|
73
|
close($fh); |
22
|
3
|
|
|
|
|
454
|
return $ctx; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub digest_file { |
26
|
2
|
|
|
2
|
1
|
1771
|
digest_file_ctx(@_)->digest; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub digest_file_hex { |
30
|
1
|
|
|
1
|
1
|
678
|
digest_file_ctx(@_)->hexdigest; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub digest_file_base64 { |
34
|
1
|
|
|
1
|
1
|
449
|
digest_file_ctx(@_)->b64digest; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |