| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Crypt::Random::Source::Base::RandomDevice; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Base class for random devices |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
|
5
|
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
2001
|
use Moo; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::File); |
|
9
|
3
|
|
|
3
|
|
789
|
use namespace::clean; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
1
|
11
|
sub rank { 100 } # good quality, pretty fast |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has '+path' => ( |
|
14
|
|
|
|
|
|
|
lazy => 1, |
|
15
|
|
|
|
|
|
|
required => 0, |
|
16
|
|
|
|
|
|
|
builder => "default_path", |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub available { |
|
20
|
6
|
|
|
6
|
1
|
466
|
-r shift->default_path; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub seed { |
|
24
|
0
|
|
|
0
|
1
|
|
my ( $self, @args ) = @_; |
|
25
|
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $fh = $self->open_handle("w+"); |
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
print $fh @args; |
|
29
|
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
close $fh; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub default_path { |
|
34
|
0
|
|
|
0
|
0
|
|
die "abstract"; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Crypt::Random::Source::Base::RandomDevice - Base class for random devices |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 0.11 |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
use Moose; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::RandomDevice); |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub default_path { "/dev/myrandom" } |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is a base class for random device sources. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
See L and |
|
64
|
|
|
|
|
|
|
L for actual implementations. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SUPPORT |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Bugs may be submitted through L |
|
69
|
|
|
|
|
|
|
(or L). |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Yuval Kogman. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
80
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
__END__ |