line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RIPEMD160; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
763
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @ISA @EXPORT); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
150
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
require DynaLoader; |
8
|
|
|
|
|
|
|
require AutoLoader; |
9
|
|
|
|
|
|
|
@ISA = qw(Exporter AutoLoader DynaLoader); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Items to export into callers namespace by default |
12
|
|
|
|
|
|
|
@EXPORT = qw(); |
13
|
|
|
|
|
|
|
$VERSION = '0.02'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
bootstrap RIPEMD160 $VERSION; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub addfile |
18
|
|
|
|
|
|
|
{ |
19
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
422
|
|
20
|
6
|
|
|
6
|
0
|
35191
|
my ($self, $handle) = @_; |
21
|
6
|
|
|
|
|
21
|
my ($package, $file, $line) = caller; |
22
|
6
|
|
|
|
|
9
|
my ($data); |
23
|
|
|
|
|
|
|
|
24
|
6
|
100
|
|
|
|
19
|
if (!ref($handle)) { |
25
|
5
|
100
|
|
|
|
43
|
$handle = $package . "::" . $handle unless ($handle =~ /(\:\:|\')/); |
26
|
|
|
|
|
|
|
} |
27
|
6
|
|
|
|
|
115
|
while (read($handle, $data, 8192)) { |
28
|
6
|
|
|
|
|
5644
|
$self->add($data); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub hexdigest |
33
|
|
|
|
|
|
|
{ |
34
|
19
|
|
|
19
|
0
|
16276
|
my ($self) = shift; |
35
|
19
|
|
|
|
|
20
|
my ($tmp); |
36
|
|
|
|
|
|
|
|
37
|
19
|
|
|
|
|
674
|
$tmp = unpack("H*", ($self->digest())); |
38
|
19
|
|
|
|
|
301
|
return(substr($tmp, 0,8) . " " . substr($tmp, 8,8) . " " . |
39
|
|
|
|
|
|
|
substr($tmp,16,8) . " " . substr($tmp,24,8) . " " . |
40
|
|
|
|
|
|
|
substr($tmp,32,8)); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub hash |
44
|
|
|
|
|
|
|
{ |
45
|
3
|
|
|
3
|
0
|
4
|
my($self, $data) = @_; |
46
|
|
|
|
|
|
|
|
47
|
3
|
50
|
|
|
|
8
|
if (ref($self)) { |
48
|
0
|
|
|
|
|
0
|
$self->reset(); |
49
|
|
|
|
|
|
|
} else { |
50
|
3
|
|
|
|
|
13
|
$self = new RIPEMD160; |
51
|
|
|
|
|
|
|
} |
52
|
3
|
|
|
|
|
17
|
$self->add($data); |
53
|
3
|
|
|
|
|
27
|
$self->digest(); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub hexhash |
57
|
|
|
|
|
|
|
{ |
58
|
10
|
|
|
10
|
0
|
106
|
my($self, $data) = @_; |
59
|
|
|
|
|
|
|
|
60
|
10
|
100
|
|
|
|
26
|
if (ref($self)) { |
61
|
1
|
|
|
|
|
5
|
$self->reset(); |
62
|
|
|
|
|
|
|
} else { |
63
|
9
|
|
|
|
|
44
|
$self = new RIPEMD160; |
64
|
|
|
|
|
|
|
} |
65
|
10
|
|
|
|
|
468
|
$self->add($data); |
66
|
10
|
|
|
|
|
24
|
$self->hexdigest(); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
__END__ |