line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Digest::Hamsi; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
293839
|
use strict; |
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
578
|
|
4
|
6
|
|
|
6
|
|
35
|
use warnings; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
226
|
|
5
|
6
|
|
|
6
|
|
17112
|
use parent qw(Exporter Digest::base); |
|
6
|
|
|
|
|
3083
|
|
|
6
|
|
|
|
|
40
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
eval { |
11
|
|
|
|
|
|
|
require XSLoader; |
12
|
|
|
|
|
|
|
XSLoader::load(__PACKAGE__, $VERSION); |
13
|
|
|
|
|
|
|
1; |
14
|
|
|
|
|
|
|
} or do { |
15
|
|
|
|
|
|
|
require DynaLoader; |
16
|
|
|
|
|
|
|
DynaLoader::bootstrap(__PACKAGE__, $VERSION); |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
20
|
|
|
|
|
|
|
hamsi_224 hamsi_224_hex hamsi_224_base64 |
21
|
|
|
|
|
|
|
hamsi_256 hamsi_256_hex hamsi_256_base64 |
22
|
|
|
|
|
|
|
hamsi_384 hamsi_384_hex hamsi_384_base64 |
23
|
|
|
|
|
|
|
hamsi_512 hamsi_512_hex hamsi_512_base64 |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub add_bits { |
27
|
200
|
|
|
200
|
0
|
195278
|
my ($self, $data, $bits) = @_; |
28
|
200
|
50
|
|
|
|
575
|
if (2 == @_) { |
29
|
0
|
|
|
|
|
0
|
return $self->_add_bits(pack('B*', $data), length $data); |
30
|
|
|
|
|
|
|
} |
31
|
200
|
|
|
|
|
9231
|
return $self->_add_bits($data, $bits); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |