4
I found an example of encrypting a string with SHA512.
public static string HashedString(string text)
{
SHA512Managed sha512 = new SHA512Managed();
byte[] hash = sha512.ComputeHash(Encoding.UTF8.GetBytes(text));
StringBuilder result = new StringBuilder();
foreach (byte b in hash)
result.Append(b);
return result.ToString();
}
But when I have print on the screen the return of this method I realize that the result is in binary and I want in hexadecimal.
And what is your doubt?
– Maniero
PQ the method is not as in the example?
– Matheus Saraiva
And why should?
– Maniero
Maniero I hope to receive the result as in the example. If you go in any generator of sha512 online, as that for example, the result you will receive is a string like the one in the example. What’s missing or what’s wrong code so I can get an equal result?
– Matheus Saraiva