20 lines
480 B
C#
20 lines
480 B
C#
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace Oms.Application.Shared;
|
|
|
|
/// <summary>
|
|
/// 统一的密码摘要工具。
|
|
/// </summary>
|
|
public static class OmsPasswordHelper
|
|
{
|
|
/// <summary>
|
|
/// 将明文密码转换为小写 MD5 字符串。
|
|
/// </summary>
|
|
public static string ToMd5(string password)
|
|
{
|
|
var bytes = MD5.HashData(Encoding.UTF8.GetBytes(password));
|
|
return Convert.ToHexString(bytes).ToLowerInvariant();
|
|
}
|
|
}
|