Jump to content

hash_hmac


doubledee

Recommended Posts

 

Do I need hash_hmac installed on my virtual server or just hash()??

 

 

Debbie

 

 

They are two completely different functions.

 

EDIT: But if you have hash(), then you also have hash_hmac(). Because they are part of the same package and were introduced to PHP in the same version (5.1.2).

Link to comment
https://forums.phpfreaks.com/topic/256093-hash_hmac/#findComment-1312845
Share on other sites

 

Do I need hash_hmac installed on my virtual server or just hash()??

 

 

Debbie

 

 

They are two completely different functions.

 

EDIT: But if you have hash(), then you also have hash_hmac(). Because they are part of the same package and were introduced to PHP in the same version (5.1.2).

 

When I look in phpinfo() I don't see hash_hmac

 

How can I verify that I have it?

 

I am chatting with GoDaddy and want to be sure I have it BEFORE I implement your fancy code in my other thread!  ;)

 

 

Debbie

 

Link to comment
https://forums.phpfreaks.com/topic/256093-hash_hmac/#findComment-1312847
Share on other sites

phpinfo() doesn't show every function known to PHP.

 

Do you have "hash"? If so, that is referring to the hash package which contains hash_hmac, among other hashing functions.

 

Once again if your PHP version is >= 5.1.2, you have hash_hmac().

 

Okay, I thought phpinfo() showed everything.

 

 

Debbie

 

Link to comment
https://forums.phpfreaks.com/topic/256093-hash_hmac/#findComment-1312853
Share on other sites

Did you look at the manual entry for function_exists? It can't hurt to learn how to use it.

 

How about this...

<?php
//function_exists — Return TRUE if the given function has been defined
//bool function_exists ( string $function_name )
//Checks the list of defined functions, both built-in (internal) and user-defined, for function_name.

$functionToCheck = 'hash_hmac';
if (function_exists($functionToCheck)){
	echo "Function '" . $functionToCheck . "' exists.";
}else{
	echo "Function '" . $functionToCheck . "' does NOT exist.";
}
?>

 

 

Debbie

 

 

Link to comment
https://forums.phpfreaks.com/topic/256093-hash_hmac/#findComment-1312856
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.