line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Passphrase::MD5::Hex; |
2
|
|
|
|
|
|
|
$Crypt::Passphrase::MD5::Hex::VERSION = '0.015'; |
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Crypt::Passphrase -validator; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
7
|
use Digest::MD5 'md5'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
215
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
2
|
|
|
2
|
1
|
39
|
my $class = shift; |
12
|
2
|
|
|
|
|
8
|
return bless {}, $class; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub accepts_hash { |
16
|
5
|
|
|
5
|
1
|
16
|
my ($self, $hash) = @_; |
17
|
5
|
|
|
|
|
27
|
return $hash =~ / ^ [a-f0-9]{32} $/xi; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub verify_password { |
21
|
2
|
|
|
2
|
1
|
7
|
my ($self, $password, $hash) = @_; |
22
|
2
|
|
|
|
|
31
|
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__ |