This commit is contained in:
lijianyou
2025-09-30 15:00:32 +08:00
parent 1b262f06b8
commit b4e759cf69
202 changed files with 22035 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
using ClockSnowFlake;
using System.Security.Cryptography;
using System.Text;
namespace dy.net.utils
{
public static class Md5Util
{
public static string JWT_TOKEN_KEY = "dy.net-key-" + IdGener.GetGuid();
public static string Md5(this string inputString)
{
// 将输入字符串转换为字节数组
byte[] inputBytes = Encoding.UTF8.GetBytes(inputString);
// 创建一个 MD5 对象
using MD5 md5 = MD5.Create();
// 计算哈希值
byte[] hashBytes = md5.ComputeHash(inputBytes);
// 将哈希值转换为十六进制字符串
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
{
sb.Append(hashBytes[i].ToString("x2"));
}
string hashString = sb.ToString();
return hashString;
}
public static string UPLOAD_PATH_PRO = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "upload");
public static string UPLOAD_PATH_DEV = Path.Combine(Directory.GetCurrentDirectory(), "upload");
}
}