sha256 check -- default to MD5
Posted: Sat Oct 11, 2008 3:40 pm
I have this incredibly complex function:
Is this enough to ensure the right function is called? Is there a way to check if sha256 is installed as a extension or does it alwasy come with the hash() familiy?
Code: Select all
function calc_hash($value)
{
if(function_exists('hash')){
return hash('sha256', $value);
}
return md5($value);
}