line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::RIPEMD160; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
75749
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
15
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
654
|
use AutoLoader; |
|
1
|
|
|
|
|
1678
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
38
|
use XSLoader; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(AutoLoader); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
XSLoader::load('Crypt::RIPEMD160', $VERSION); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#package RIPEMD160; # Package-Definition like in Crypt::IDEA |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#use strict; |
18
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
67
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub addfile |
21
|
|
|
|
|
|
|
{ |
22
|
1
|
|
|
1
|
|
8
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
375
|
|
23
|
3
|
|
|
3
|
0
|
1092794
|
my ($self, $handle) = @_; |
24
|
3
|
|
|
|
|
13
|
my ($package, $file, $line) = caller; |
25
|
3
|
|
|
|
|
8
|
my ($data); |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
14
|
if (!ref($handle)) { |
28
|
2
|
50
|
|
|
|
22
|
$handle = $package . "::" . $handle unless ($handle =~ /(\:\:|\')/); |
29
|
|
|
|
|
|
|
} |
30
|
3
|
|
|
|
|
87
|
while (read($handle, $data, 8192)) { |
31
|
3
|
|
|
|
|
507
|
$self->add($data); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub hexdigest |
36
|
|
|
|
|
|
|
{ |
37
|
16
|
|
|
16
|
0
|
11393
|
my ($self) = shift; |
38
|
16
|
|
|
|
|
22
|
my ($tmp); |
39
|
|
|
|
|
|
|
|
40
|
16
|
|
|
|
|
112
|
$tmp = unpack("H*", ($self->digest())); |
41
|
16
|
|
|
|
|
106
|
return(substr($tmp, 0,8) . " " . substr($tmp, 8,8) . " " . |
42
|
|
|
|
|
|
|
substr($tmp,16,8) . " " . substr($tmp,24,8) . " " . |
43
|
|
|
|
|
|
|
substr($tmp,32,8)); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub hash |
47
|
|
|
|
|
|
|
{ |
48
|
3
|
|
|
3
|
0
|
9
|
my($self, $data) = @_; |
49
|
|
|
|
|
|
|
|
50
|
3
|
50
|
|
|
|
9
|
if (ref($self)) { |
51
|
0
|
|
|
|
|
0
|
$self->reset(); |
52
|
|
|
|
|
|
|
} else { |
53
|
3
|
|
|
|
|
10
|
$self = Crypt::RIPEMD160->new; |
54
|
|
|
|
|
|
|
} |
55
|
3
|
|
|
|
|
18
|
$self->add($data); |
56
|
3
|
|
|
|
|
22
|
$self->digest(); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub hexhash |
60
|
|
|
|
|
|
|
{ |
61
|
10
|
|
|
10
|
0
|
1288
|
my($self, $data) = @_; |
62
|
|
|
|
|
|
|
|
63
|
10
|
100
|
|
|
|
25
|
if (ref($self)) { |
64
|
1
|
|
|
|
|
5
|
$self->reset(); |
65
|
|
|
|
|
|
|
} else { |
66
|
9
|
|
|
|
|
29
|
$self = Crypt::RIPEMD160->new; |
67
|
|
|
|
|
|
|
} |
68
|
10
|
|
|
|
|
346
|
$self->add($data); |
69
|
10
|
|
|
|
|
23
|
$self->hexdigest(); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |