This commit is contained in:
2022-12-16 06:01:23 +00:00
parent 26c2ae5cc9
commit effd96143f
310 changed files with 48715 additions and 0 deletions

27
server/util/FileHash.cs Normal file
View File

@@ -0,0 +1,27 @@
using System.IO;
using System.Security.Cryptography;
using System;
namespace Sockeye.Util
{
internal static class FileHash
{
internal static string GetChecksum(string filePath)
{
using (FileStream stream = File.OpenRead(filePath))
{
//SHA256Managed sha = new SHA256Managed();
var sha= SHA256.Create();
byte[] checksum = sha.ComputeHash(stream);
return BitConverter.ToString(checksum).Replace("-", String.Empty);
}
}
}//eoc
}//eons