Passphrase/SHA1/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/MD5/Hex.pm ↑ Summary Passphrase/MD5/Base64.pm »
1 package Crypt::Passphrase::SHA1::Hex;
2 2 $Crypt::Passphrase::SHA1::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::SHA 'sha1';
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 4 ▶sub accepts_hash {
Subroutine accepts_hash: called CC=1 SCAR=0.0
Pod documented
16 4 my ($self, $hash) = @_;
17 4 return $hash =~ / ^ [a-f0-9]{40} \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(sha1($password), pack 'H40', $hash);
23 }
24  
25 2 1;
26  
27 # ABSTRACT: Validate against hexed SHA1 hashes with Crypt::Passphrase
28  
29 __END__
« Passphrase/MD5/Hex.pm ↑ Summary Passphrase/MD5/Base64.pm »