diff --git a/GameFrameX.Foundation.Hash/Md5Helper.cs b/GameFrameX.Foundation.Hash/Md5Helper.cs index a6e8c36..4ffa69d 100644 --- a/GameFrameX.Foundation.Hash/Md5Helper.cs +++ b/GameFrameX.Foundation.Hash/Md5Helper.cs @@ -31,6 +31,7 @@ // Official Documentation: https://gameframex.doc.alianblank.com/ // ========================================================================================== +using System.Diagnostics.CodeAnalysis; using System.Security.Cryptography; using System.Text; @@ -104,6 +105,7 @@ public static string HashWithSalt(string input, string salt, bool isUpper = fals /// 是否返回大写形式的哈希值,默认为false返回小写 / Whether to return uppercase hash, defaults to false for lowercase /// 32个字符的十六进制字符串形式的哈希值 / A 32-character hexadecimal string hash value /// 为 null 时抛出 / Thrown when or is null + [SuppressMessage("Sonar Code Smell", "S4790:Use a stronger hashing algorithm", Justification = "MD5 is intentionally used here for non-cryptographic checksum / fingerprint / cache-key scenarios; for security-sensitive use cases call Sha256Helper instead.")] public static string HashWithSalt(string input, byte[] salt, bool isUpper = false) { ArgumentNullException.ThrowIfNull(input, nameof(input));