25 lines
529 B
C#
25 lines
529 B
C#
using System.IO;
|
|
using System.Security.Cryptography;
|
|
using System;
|
|
|
|
namespace AyaNova.Util
|
|
{
|
|
|
|
|
|
internal static class FileHash
|
|
{
|
|
|
|
internal static string GetChecksum(string filePath)
|
|
{
|
|
using (FileStream stream = File.OpenRead(filePath))
|
|
{
|
|
SHA256Managed sha = new SHA256Managed();
|
|
byte[] checksum = sha.ComputeHash(stream);
|
|
return BitConverter.ToString(checksum).Replace("-", String.Empty);
|
|
}
|
|
}
|
|
|
|
|
|
}//eoc
|
|
|
|
}//eons |