public static string GetSHA512String(byte[] block) { using (SHA512 sha512 = SHA512.Create()) { return(StringTools.ToHex(sha512.ComputeHash(block))); } }
public static string GetSHA512StringByFile(string file) { using (SHA512 sha512 = SHA512.Create()) using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read)) { return(StringTools.ToHex(sha512.ComputeHash(fs))); } }