using System.Security.Cryptography;
string inputString = "ashok";
string sha512Hash = ComputeSHA512Hash(inputString);
Console.WriteLine($"Input: {inputString}");
Console.WriteLine($"SHA-512 Hash: {sha512Hash}");
static string ComputeSHA512Hash(string input)
using (SHA512 sha512 = SHA512.Create())
byte[] inputBytes = Encoding.UTF8.GetBytes(input);
byte[] hashBytes = sha512.ComputeHash(inputBytes);
StringBuilder stringBuilder = new StringBuilder();
foreach (byte b in hashBytes)
stringBuilder.Append(b.ToString("x2"));
return stringBuilder.ToString();