Parsing MD5 Values of existent files to determine which files are out of date

This commit is contained in:
2021-05-25 11:33:38 +02:00
parent 01584ad263
commit abd5b1b98f
3 changed files with 52 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace EZPPClient_Installer
{
class MD5Util
{
public static string CalculateMD5(string filename)
{
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(filename))
{
var hash = md5.ComputeHash(stream);
return BitConverter.ToString(hash).Replace("-", "").ToUpperInvariant();
}
}
}
}
}