0
2
llucycodes42
The code computes the MD5 hash of the data in the stream and returns that value as a string.
Shortcut: ex_md5_from_stream
public static string GetMD5(this System.IO.Stream stream)
{
stream.Position = 0;
var arrayByteHashValue = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(stream);
return BitConverter.ToString(arrayByteHashValue).Replace("-", String.Empty).ToLower();
}