line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Passphrase::Encoder; |
2
|
|
|
|
|
|
|
$Crypt::Passphrase::Encoder::VERSION = '0.014'; |
3
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
136
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1376
|
use parent 'Crypt::Passphrase::Validator'; |
|
3
|
|
|
|
|
1050
|
|
|
3
|
|
|
|
|
17
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
1429
|
use Crypt::URandom; |
|
3
|
|
|
|
|
10864
|
|
|
3
|
|
|
|
|
516
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub random_bytes { |
11
|
1
|
|
|
1
|
1
|
3
|
my ($self, $count) = @_; |
12
|
1
|
|
|
|
|
6
|
return Crypt::URandom::urandom($count); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub crypt_subtypes; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub accepts_hash { |
18
|
10
|
|
|
10
|
1
|
25
|
my ($self, $hash) = @_; |
19
|
10
|
50
|
|
|
|
31
|
return 0 if not defined $hash; |
20
|
10
|
|
66
|
|
|
50
|
$self->{accepts_hash} //= do { |
21
|
5
|
50
|
|
|
|
21
|
my $string = join '|', $self->crypt_subtypes or return; |
22
|
5
|
|
|
|
|
146
|
qr/ \A \$ (?: $string ) \$ /x; |
23
|
|
|
|
|
|
|
}; |
24
|
10
|
|
|
|
|
96
|
return $hash =~ $self->{accepts_hash}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub binary_safe { |
28
|
0
|
|
|
0
|
1
|
|
return 1; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#ABSTRACT: Base class for Crypt::Passphrase encoders |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |