mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-12 11:32:33 +02:00
20 lines
459 B
C#
20 lines
459 B
C#
using System.IO;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace UVtools.Core.Objects
|
|
{
|
|
public static class StaticObjects
|
|
{
|
|
public static SHA256 Sha256 { get; } = SHA256.Create();
|
|
|
|
// Compute the file's hash.
|
|
public static byte[] GetHashSha256(string filename)
|
|
{
|
|
using (var stream = File.OpenRead(filename))
|
|
{
|
|
return Sha256.ComputeHash(stream);
|
|
}
|
|
}
|
|
}
|
|
}
|