note 76253 added to ref.mhash
| From: | ludicruz at yahoo dot com | Date: | Sat, 07 Jul 2007 20:41:42 +0000 |
| Subject: | note 76253 added to ref.mhash | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128287@lists.php.net to get a copy of this message | ||
to robert at mediamonks dot com
This will work better, in your function you can just use the constant function to pull in the actual
value of MHASH_SHA512 or whatever.
function getHashNotWorking($argStrHashMethod, $argStrString)
{
$strHashMethod = 'MHASH_' . $argStrHashMethod;
$strHashedString = bin2hex(mhash(constant($strHashMethod), $argStrString));
return $strHashedString;
}
now:
echo getHashNotWorking('SHA512', 'some string');
works how you want it.
----
Server IP: 208.69.120.35
Probable Submitter: 24.28.107.74
----
Manual Page -- http://www.php.net/manual/en/ref.mhash.php
Edit -- https://master.php.net/note/edit/76253
Del: integrated -- https://master.php.net/note/delete/76253/integrated
Del: useless -- https://master.php.net/note/delete/76253/useless
Del: bad code -- https://master.php.net/note/delete/76253/bad+code
Del: spam -- https://master.php.net/note/delete/76253/spam
Del: non-english -- https://master.php.net/note/delete/76253/non-english
Del: in docs -- https://master.php.net/note/delete/76253/in+docs
Del: other reasons-- https://master.php.net/note/delete/76253
Reject -- https://master.php.net/note/reject/76253
Search -- https://master.php.net/manage/user-notes.php