blib/lib/UUID/Generator/PurePerl/RNG/Bridge.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 9 | 16 | 56.2 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 4 | 75.0 |
pod | 0 | 1 | 0.0 |
total | 12 | 21 | 57.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package UUID::Generator::PurePerl::RNG::Bridge; | ||||||
2 | |||||||
3 | 6 | 6 | 28 | use strict; | |||
6 | 6 | ||||||
6 | 155 | ||||||
4 | 6 | 6 | 21 | use warnings; | |||
6 | 7 | ||||||
6 | 119 | ||||||
5 | |||||||
6 | 6 | 6 | 1525 | use Digest; | |||
6 | 1635 | ||||||
6 | 592 | ||||||
7 | |||||||
8 | sub gen_seed_32bit { | ||||||
9 | 0 | 0 | 0 | my $d = Digest->new('MD5'); | |||
10 | 0 | $d->add(pack('I', time)); | |||||
11 | 0 | my $r = $d->digest; | |||||
12 | 0 | my $x = 0; | |||||
13 | 0 | while (length $r > 0) { | |||||
14 | 0 | $x ^= unpack 'I', substr($r, 0, 4, q{}); | |||||
15 | } | ||||||
16 | 0 | return $x; | |||||
17 | } | ||||||
18 | |||||||
19 | sub rand_32bit; | ||||||
20 | |||||||
21 | 1; | ||||||
22 | __END__ |