AlexTape has asked for the wisdom of the Perl Monks concerning the following question:
IMHO this argument should be true.. use Digest::MD5 qw(md5 md5_hex md5_base64); .. # md5 salt my $salt = "any_salt"; #constructor sub new { my ($class) = @_; my $self = $class->SUPER::new(); $self->{_NAME} = $_[1]; $self->{_PASSWORD} = $_[2]; bless $self, $class and return $self; } sub ENCRYPT { return "[" . md5_base64( md5_hex( md5( "[" . $salt . $_[0] ) ) ) . + "]"; } ...
but it isnīt!$user->ENCRYPT("test") eq User::ENCRYPT("test")
each time i execute it, $User->ENCRYPT returns another hash... so what happens?!User::ENCRYPT = [pFEzt3UedzYAtjFwAGLDRQ] $User->ENCRYPT = [TmLr4v17FTUVqcO+Gb2K/Q]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Digest::MD5 variation problem?
by Your Mother (Archbishop) on Aug 22, 2013 at 14:28 UTC | |
|
Re: Digest::MD5 variation problem?
by Corion (Patriarch) on Aug 22, 2013 at 14:25 UTC | |
by AlexTape (Monk) on Aug 22, 2013 at 14:32 UTC | |
|
Re: Digest::MD5 variation problem?
by zork42 (Monk) on Aug 23, 2013 at 06:31 UTC | |
by AlexTape (Monk) on Aug 23, 2013 at 12:04 UTC | |
by zork42 (Monk) on Aug 24, 2013 at 03:49 UTC | |
by AlexTape (Monk) on Sep 04, 2013 at 11:15 UTC | |
by afoken (Chancellor) on Aug 24, 2013 at 08:37 UTC |