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).

 

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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.