Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        private void computeMD5()
        {
            StringBuilder hash = new StringBuilder();

            Header.MD5 = SECRET_KEY;

            hash.Append(MD5Helper.ComputeHash(BinaryHelper.Serialize(Header)));

            for (int i = 0; i < Header.Count; i++)
            {
                using (FileStream fs = new FileStream(Path.Combine(WorkDirectory, Header[i].FileName), FileMode.Open))
                {
                    hash.Append(MD5Helper.ComputeHash(fs));
                }
            }

            Header.MD5 = MD5Helper.ComputeHash(hash.ToString());
        }