You are on page 1of 1

<?

php
/*this returns sha512 128string
sha256 64
*/
function sha2($string){
$fp = tmpfile();
fwrite($fp, $string);
rewind($fp);
$ctx = hash_init('sha512');
hash_update_stream($ctx, $fp);
return hash_final($ctx);
}
?>

You might also like