line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Passphrase::MD5::Hex; |
2
|
|
|
|
|
|
|
$Crypt::Passphrase::MD5::Hex::VERSION = '0.014'; |
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Crypt::Passphrase -validator; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
7
|
use Digest::MD5 'md5'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
197
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
2
|
|
|
2
|
1
|
35
|
my $class = shift; |
12
|
2
|
|
|
|
|
8
|
return bless {}, $class; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub accepts_hash { |
16
|
5
|
|
|
5
|
1
|
13
|
my ($self, $hash) = @_; |
17
|
5
|
|
|
|
|
27
|
return $hash =~ / ^ [a-f0-9]{32} $/xi; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub verify_password { |
21
|
2
|
|
|
2
|
1
|
5
|
my ($self, $password, $hash) = @_; |
22
|
2
|
|
|
|
|
41
|
return md5($password) eq pack('H32', $hash); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# ABSTRACT: Validate against hexed MD5 hashes with Crypt::Passphrase |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |