note 55737 deleted from ref.mhash by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 14:53:42 +0000 |
| Subject: | note 55737 deleted from ref.mhash by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197205@lists.php.net to get a copy of this message | ||
Note Submitter: brentdothansenatgmaildotcom
----
Since it seems that the tiger hash bug has been labeled "bogus" here is a fix to give a
correct result. I'm not a binary expert so if you come up with a better fix please let us
know. Just do your MHASH_TIGER as normal then send the unaltered binary into tigerfix and you get a
proper HEX return.
function tigerfix ($binary_hash) {
$my_split = str_split($binary_hash,8);
$my_tiger ="";
foreach($my_split as $key => $value) {
$my_split[$key] = strrev($value);
$my_tiger .= $my_split[$key];
}
$my_tiger_hex = bin2hex($my_tiger);
return $my_tiger_hex;
}