Passphrase/MD5/Hex.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 66.6% 2 / 3 totaltotal 96.6% 29 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Passphrase/Validator.pm ↑ Summary Passphrase/SHA1/Hex.pm »
1 package Crypt::Passphrase::MD5::Hex;
2 2 $Crypt::Passphrase::MD5::Hex::VERSION = '0.024';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use parent 'Crypt::Passphrase::Validator';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Digest::MD5 'md5';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 2 my $class = shift;
12 2 return bless {}, $class;
13 }
14  
15 5 ▶sub accepts_hash {
Subroutine accepts_hash: called CC=1 SCAR=0.0
Pod documented
16 5 my ($self, $hash) = @_;
17 5 return $hash =~ / ^ [a-f0-9]{32} \z /xi;
18 }
19  
20 2 ▶sub verify_password {
Subroutine verify_password: called CC=1 SCAR=0.0
Pod documented
21 2 my ($self, $password, $hash) = @_;
22 2 return $self->secure_compare(md5($password), pack 'H32', $hash);
23 }
24  
25 2 1;
26  
27 # ABSTRACT: Validate against hexed MD5 hashes with Crypt::Passphrase
28  
29 __END__
« Passphrase/Validator.pm ↑ Summary Passphrase/SHA1/Hex.pm »