Написана система взаимодействия со строками

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-02-20 20:09:17 +07:00
parent ba6483ef1b
commit 527aae7b40
14 changed files with 579 additions and 0 deletions

27
Utils.cs Normal file
View File

@@ -0,0 +1,27 @@
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace SaveWizard_rewritten
{
static class Utils
{
public static string GenerateMD5(string filename)
{
if (!File.Exists(filename))
return null;
using (var md5 = MD5.Create())
{
using (FileStream stream = File.OpenRead(filename))
md5.ComputeHash(stream);
StringBuilder sb = new StringBuilder();
byte[] hash = md5.Hash;
for (int i = 0; i < hash.Length; i++)
sb.Append(hash[i].ToString("x2"));
return sb.ToString();
}
}
}
}