mysimulation/server/tso.common/Utils/FileUtils.cs
Tony Bark 22191ce648 Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib
- Added FreeSO's API server to handle most backend operations
2024-05-01 02:55:43 -04:00

25 lines
648 B
C#
Executable file

using System;
using System.IO;
using System.Security.Cryptography;
namespace FSO.Common.Utils
{
public class FileUtils
{
public static string ComputeMD5(string filePath){
var bytes = ComputeMD5Bytes(filePath);
return BitConverter.ToString(bytes).Replace("-", "").ToLowerInvariant();
}
public static byte[] ComputeMD5Bytes(string filePath)
{
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(filePath))
{
return md5.ComputeHash(stream);
}
}
}
}
}