功能添加
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace Entity;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件消息实体
|
||||
@@ -29,4 +31,14 @@ public class EmailMessage : BaseEntity
|
||||
/// 邮件接收时间
|
||||
/// </summary>
|
||||
public DateTime ReceivedDate { get; set; }
|
||||
|
||||
public string Md5 { get; set; } = string.Empty;
|
||||
|
||||
public string ComputeBodyHash()
|
||||
{
|
||||
using var md5 = MD5.Create();
|
||||
var inputBytes = System.Text.Encoding.UTF8.GetBytes(Body + HtmlBody);
|
||||
var hashBytes = md5.ComputeHash(inputBytes);
|
||||
return Convert.ToHexString(hashBytes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user