Posted by Sander on 09/21/05 12:19
"Shabam" <chalupa@yomama-nospam.com> schreef in bericht
news:2p-dnZ0l69mtv6zeRVn-hA@adelphia.com...
> How do I find out if my PHP supports SHA1?
>
> And if it doesn't how do I compile it in?
>
>
It depends on the PHP version you are using. PHP>=4.3.0 and PHP 5.x has this
standard. When you have a version that is outdated:
*****from the comments of http://nl2.php.net/sha1 *****
install the mhash library (see http://mhash.sourceforge.net)
then, sha1 can be implemented as follows:
function sha1($hash_source) {
$hash = mhash(MHASH_SHA1, $hash_source);
$hex_hash = bin2hex($hash);
return $hex_hash;
}
*********** end of the comments ******
But you better update to the latest version anyway.
Good Luck,
Sander Swuste
[Back to original message]
|