欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

.net Core 登录密码使用MD5算法加密

程序员文章站 2024-01-04 15:58:40
...
 public string Login(LoginModel model)
        {
            string Salt = "[email protected]#trtailw!#@";
            model.Password = BitConverter.ToString(
                MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(model.Password + Salt))
                ).Replace("-","");
            return _loginRepository.Login(model);
        }       

记得要引入“System.Security.Cryptography.Algorithms” NuGet包。

相关标签: .net Core

上一篇:

下一篇: