Re: MD5 usage

From: Date: Tue, 22 Oct 2002 21:50:40 +0000
Subject: Re: MD5 usage
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120988@lists.php.net to get a copy of this message
> I'm using > > $string = 'test'; > md5($string); > > to crypt $string. I get the hash output and works fine. > > Now, how do I retrieve and check that info? is there a decrypt method ? No. Use a method like this: $string = 'test'; $hash = md5($string); if(md5($string_to_test) == $hash) { echo "match"; } else { echo "no match"; } You have to compare hashes to see if the strings are equal. ---John Holmes...

« previous php.general (#120988) next »