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.12'; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1208
|
use Moo; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
11
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::File); |
9
|
3
|
|
|
3
|
|
526
|
use namespace::clean; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
14
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
1
|
6
|
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
|
320
|
-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.12 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
use Moo; |
54
|
|
|
|
|
|
|
extends qw(Crypt::Random::Source::Base::RandomDevice); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub default_path { "/dev/myrandom" } |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This is a base class for random device sources. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
See L and |
63
|
|
|
|
|
|
|
L for actual implementations. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SUPPORT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Bugs may be submitted through L |
68
|
|
|
|
|
|
|
(or L). |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2008 by Yuval Kogman. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |