using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace ChadSoft
{
///
/// Provides methods for helping with encryption.
///
public class EncryptionUtility
{
///
/// Computes the hash (aka "MD5 Sum") for a given stream.
///
/// The stream.
/// The MD5 hash for the stream.
public static string ComputeHash(Stream stream)
{
StringBuilder sb = new StringBuilder();
foreach (byte byt in MD5.Create().ComputeHash(stream))
sb.AppendFormat(byt.ToString("x2").ToLower());
return sb.ToString();
}
}
}