line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Password::Pronounceable::RandomCase; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
47336
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
82
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
63
|
|
5
|
2
|
|
|
2
|
|
2016
|
use parent 'Text::Password::Pronounceable'; |
|
2
|
|
|
|
|
674
|
|
|
2
|
|
|
|
|
12
|
|
6
|
2
|
|
|
2
|
|
7906
|
use Readonly; |
|
2
|
|
|
|
|
6965
|
|
|
2
|
|
|
|
|
601
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub generate { |
11
|
4
|
|
|
4
|
1
|
1793
|
my ( $self, $min, $max, $prob ) = @_; |
12
|
4
|
|
|
|
|
15
|
Readonly::Scalar my $DEFAULT_PROBALITITY => 4; |
13
|
4
|
|
|
|
|
87
|
Readonly::Scalar my $DEFAULT_LENGTH => 8; |
14
|
|
|
|
|
|
|
|
15
|
4
|
100
|
|
|
|
69
|
if (ref $self) { |
16
|
3
|
|
66
|
|
|
18
|
$min ||= $self->{min}; |
17
|
3
|
|
66
|
|
|
15
|
$max ||= $self->{max}; |
18
|
3
|
|
66
|
|
|
13
|
$prob ||= $self->{prob}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
4
|
|
33
|
|
|
8
|
$min ||= $DEFAULT_LENGTH; |
22
|
4
|
|
33
|
|
|
9
|
$max ||= $min; |
23
|
4
|
|
66
|
|
|
11
|
$prob ||= $DEFAULT_PROBALITITY; |
24
|
|
|
|
|
|
|
|
25
|
4
|
|
|
|
|
23
|
my $password = $self->SUPER::generate( $min, $max ); |
26
|
|
|
|
|
|
|
|
27
|
4
|
100
|
|
|
|
805
|
return join '', map { int rand $prob ? $_ : uc } split //xms, $password; |
|
64
|
|
|
|
|
187
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
1
|
|
|
1
|
1
|
33
|
my ( $class, $min, $max, $prob ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
9
|
return bless { min => $min, max => $max, prob => $prob }, $class; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |