C# SHA-2 (512) Base64 encoded hash

Would System.Security.Cryptography.SHA512 be what you need?

var alg = SHA512.Create();
alg.ComputeHash(Encoding.UTF8.GetBytes("test"));
BitConverter.ToString(alg.Hash).Dump();

Executed in LINQPad produces:

EE-26-B0-DD-4A-F7-E7-49-AA-1A-8E-E3-C1-0A-E9-92-3F-61-89-80-77-2E-47-3F-88-19-A5-D4-94-0E-0D-B2-7A-C1-85-F8-A0-E1-D5-F8-4F-88-BC-88-7F-D6-7B-14-37-32-C3-04-CC-5F-A9-AD-8E-6F-57-F5-00-28-A8-FF

To create the method from your question:

public static string sha512Hex(byte[] data)
{
    using (var alg = SHA512.Create())
    {
        alg.ComputeHash(data);
        return BitConverter.ToString(alg.Hash);
    }
}

Got this to work. Taken from here and modified a bit.

    public static string CreateSHAHash(string Phrase)
    {
        SHA512Managed HashTool = new SHA512Managed();
        Byte[] PhraseAsByte = System.Text.Encoding.UTF8.GetBytes(string.Concat(Phrase));
        Byte[] EncryptedBytes = HashTool.ComputeHash(PhraseAsByte);
        HashTool.Clear();
        return Convert.ToBase64String(EncryptedBytes);
    }

Tags:

C#

Encryption