27 lines
590 B
C#
27 lines
590 B
C#
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 |