mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-23 04:29:36 +08:00

* 补充数据库表 * 更新sqlite * 添加商店相关的数据库常量类 * add Update_UpdateRoomMaster * 修改常量类 * 添加 NOTICE 文件 * 添加市场、报价、库存的数据库常量类 * 优化表结构和查询常量类 * 添加 UserCenter 和 Inventory 相关枚举;数据表和 Query 常量类修改 * 添加报价的核心操作 * 涉及库存的物品获取应该使用 Guid 而不是 ItemId --------- Co-authored-by: yeziuku <yezi@wrss.org>
29 lines
914 B
C#
29 lines
914 B
C#
namespace Milimoe.FunGame.Core.Api.Utility
|
||
{
|
||
/// <summary>
|
||
/// 为字符串(string)添加扩展方法
|
||
/// </summary>
|
||
public static class StringExtension
|
||
{
|
||
/// <summary>
|
||
/// 使用 HMAC-SHA512 算法对文本进行加密<para/>
|
||
/// </summary>
|
||
/// <param name="text">需要加密的文本</param>
|
||
/// <param name="key">用于加密的秘钥</param>
|
||
/// <returns>加密后的 HMAC-SHA512 哈希值</returns>
|
||
public static string Encrypt(this string text, string key)
|
||
{
|
||
return Encryption.HmacSha512(text, key.ToLower());
|
||
}
|
||
|
||
public static bool EqualsGuid(this string str, object? value)
|
||
{
|
||
if (str.ToLower().Replace("-", "").Equals(value?.ToString()?.ToLower().Replace("-", "")))
|
||
{
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
}
|
||
}
|