I would like to ask how to convert SHA512 to String?
<?php
$shatest = ("Erl");
$sha512test = hash("sha512",$shatest);
echo $sha512test;
?>
Output: 7bce51762913cd5f8c748c061dcfc5f75a2ca9b8e46372f9ebf9ec9e7450180ce5735a21d23860e945b5935ed89d7d851d30a6ab5ae765d09f4282553f9cf4f3
I would like to convert the output: (7bce51762913cd5f8c748c061dcfc5f75a2ca9b8e46372f9ebf9ec9e7450180ce5735a21d23860e945b5935ed89d7d851d30a6ab5ae765d09f4282553f9cf4f3) to string.
Please help thanks.
CodePudding user response:
The return type for the hash function in php is a string. That long sequence of characters representing the sha512 hash value of "Erl" is a string. So the variable $sha512test is already a string.