Source/Base/RandomDevice.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 75.0% 3 / 4 totaltotal 62.9% 17 / 27 CC 1 SCAR 4.1
CC
1
Cov
65%
rank
2.0
seed
2.0
default_path
2.0
CRAP 1.5
« Source/Base/File.pm ↑ Summary Source/Strong/devrandom.pm »
1 package Crypt::Random::Source::Base::RandomDevice;
2 # ABSTRACT: Base class for random devices
3  
4 3 our $VERSION = '0.14';
5  
6 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 extends qw(Crypt::Random::Source::Base::File);
9 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 0 ▶sub rank { 100 } # good quality, pretty fast
Subroutine rank: not called CC=1 SCAR=6.9
Pod documented
12  
13 3 has '+path' => (
14 lazy => 1,
15 required => 0,
16 builder => "default_path",
17 );
18  
19 6 ▶sub available {
Subroutine available: called CC=1 SCAR=0.0
Pod documented
20 6 -r shift->default_path;
21 }
22  
23 0 ▶sub seed {
Subroutine seed: not called CC=1 SCAR=6.9
Pod documented
24 0 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 0 ▶sub default_path {
Subroutine default_path: not called CC=1 SCAR=6.9
Pod undocumented
34 0 die "abstract";
35 }
36  
37 3 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.14
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<Crypt::Random::Source::Strong::devrandom> and
63 L<Crypt::Random::Source::Weak::devurandom> for actual implementations.
64  
65 =head1 SUPPORT
66  
67 Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-Random-Source>
68 (or L<bug-Crypt-Random-Source@rt.cpan.org|mailto:bug-Crypt-Random-Source@rt.cpan.org>).
69  
70 =head1 AUTHOR
71  
72 יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
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__
« Source/Base/File.pm ↑ Summary Source/Strong/devrandom.pm »