| 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__ | ||