private static byte[] CalcHash(string directory, InputParams inputParams)
{
MemoryStream memoryStream = new MemoryStream();
// build a stream of the directory contents we want to hash
BuildCRCStream(directory, inputParams, ref memoryStream);
// create the hash
MD5 md5 = MD5.Create();
return md5.ComputeHash(memoryStream.GetBuffer());
}