/// <summary> /// Calculates the SHA512 hash of a stream /// </summary> /// <param name="stream"></param> /// <returns></returns> public static string GetStreamHashSHA512(Stream stream) { string result = null; using (HashAlgorithm algo = new SHA512Managed()) { algo.TranformStream(stream); result = algo.GetAsString(); algo.Clear(); } return(result); }