daily update on 20240419 by nitload youmu, SSD merged into main stream

This commit is contained in:
YoumuLiu
2024-04-20 02:36:36 +08:00
parent efeb4ba058
commit 7b67eb2f4d
81 changed files with 4568 additions and 33 deletions
@@ -31,7 +31,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
@@ -40,8 +42,28 @@ namespace StgSharp
public static unsafe partial class StgSharp
{
static byte[] _currentHash;
private static bool _inited;
public static byte[] CurrentAssemblyHash
{
get
{
if (_currentHash == null)
{
string route = Assembly.GetExecutingAssembly().Location;
string time = DateTime.UtcNow.ToString();
using (SHA256 sh = SHA256.Create())
{
byte[] bytes = Encoding.UTF8.GetBytes(route);
_currentHash = sh.ComputeHash(bytes);
}
}
return _currentHash;
}
}
/// <summary>
/// Init an instance of OpenGL program,
/// This method should be called before any other StgSharp api.
@@ -76,5 +98,5 @@ namespace StgSharp
}
}
}//------------------------end of class------------------------//
}