2020-12-25 10:49:51 -05:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
|
|
|
namespace auto_creamapi.Models
|
|
|
|
{
|
|
|
|
internal class CreamDll
|
|
|
|
{
|
|
|
|
public readonly string Filename;
|
|
|
|
public readonly string Hash;
|
2020-12-28 09:27:37 -05:00
|
|
|
public readonly string OrigFilename;
|
2020-12-25 10:49:51 -05:00
|
|
|
|
|
|
|
public CreamDll(string filename, string origFilename)
|
|
|
|
{
|
|
|
|
Filename = filename;
|
|
|
|
OrigFilename = origFilename;
|
|
|
|
Hash = "";
|
|
|
|
|
|
|
|
using var md5 = MD5.Create();
|
|
|
|
if (File.Exists(Filename))
|
|
|
|
{
|
|
|
|
using var stream = File.OpenRead(Filename);
|
|
|
|
Hash = BitConverter
|
|
|
|
.ToString(md5.ComputeHash(stream))
|
|
|
|
.Replace("-", string.Empty);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-28 09:27:37 -05:00
|
|
|
|
2020-12-25 10:49:51 -05:00
|
|
|
public class CreamDllModel
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|