Passphrase/Validator.pm

filter: Statementstmt 100% 15 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 19 / 19 CC 2 SCAR 4.1
CC
2
Cov
100%
secure_compare
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Passphrase/PassphraseHash.pm ↑ Summary Passphrase/MD5/Hex.pm »
1 package Crypt::Passphrase::Validator;
2 13 $Crypt::Passphrase::Validator::VERSION = '0.024';
3 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 our @CARP_NOT = 'Crypt::Passphrase';
7  
8 33 ▶sub secure_compare {
Subroutine secure_compare: called CC=2 SCAR=6.9
Pod documented
9 33 my ($self, $up, $down) = @_;
10 33 my $r = length $up != length $down;
11 33 my $left = $up . $down;
12 33 my $right = $down . $up;
13 33 $r |= ord(substr $left, $_, 1) ^ ord(substr $right, $_, 1) for 0 .. length($left) - 1;
14 33 return $r == 0;
15 }
16  
17 13 1;
18  
19 #ABSTRACT: Base class for Crypt::Passphrase validators
20  
21 __END__
« Passphrase/PassphraseHash.pm ↑ Summary Passphrase/MD5/Hex.pm »