mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-15 14:51:21 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
25 lines
648 B
C#
Executable file
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|