| 1 | package Crypt::Passphrase::Encoder; | ||||||||||||||||||||
| 2 | 7 | $Crypt::Passphrase::Encoder::VERSION = '0.024'; | |||||||||||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 7 | ▶ | use parent 'Crypt::Passphrase::Validator'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 7 | ▶ | use Crypt::SysRandom; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 16 | ▶ | sub random_bytes { | ||||||||||||||||||
|
Subroutine
random_bytes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 11 | 16 | my ($self, $count) = @_; | |||||||||||||||||||
| 12 | 16 | return Crypt::SysRandom::random_bytes($count); | |||||||||||||||||||
| 13 | } | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | sub crypt_subtypes; | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 28 | ▶ | sub accepts_hash { | ||||||||||||||||||
|
Subroutine
accepts_hash: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||
| 18 | 28 | my ($self, $hash) = @_; | |||||||||||||||||||
| 19 | 28 | ▶ | $self->{accepts_hash} //= do { | ||||||||||||||||||
|
Condition66%2/3
$self->{"accepts_hash"} //= do {
my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return;
qr/ \A \$ (?: $string ) [\$,] /x
}
MC/DC0%0/2
$self->{"accepts_hash"} //= do {
my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return;
qr/ \A \$ (?: $string ) [\$,] /x
}
$self->{"accepts_hash"}
do {
my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return;
qr/ \A \$ (?: $string ) [\$,] /x
}
Truth table66%2/3
A //= B
A= $self->{"accepts_hash"}B= do {
my $string = join("|", map({quotemeta $_;} $self->crypt_subtypes)) or return;
qr/ \A \$ (?: $string ) [\$,] /x
}
| |||||||||||||||||||||
| 20 | 20 | ▶ | my $string = join '|', map { quotemeta } $self->crypt_subtypes or return; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | 20 | qr/ \A \$ (?: $string ) [\$,] /x; | |||||||||||||||||||
| 22 | }; | ||||||||||||||||||||
| 23 | 28 | return scalar $hash =~ $self->{accepts_hash}; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | sub recode_hash { | ||||||||||||||||||
|
Subroutine
recode_hash: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 27 | 0 | my ($self, $hash, @args) = @_; | |||||||||||||||||||
| 28 | 0 | return $hash; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 7 | 1; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | #ABSTRACT: Base class for Crypt::Passphrase encoders | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||