来自如何在C#中对字符串进行SHA512处理?的.NET 6代码
var data = Encoding.UTF8.GetBytes("key");
byte[] hash;
using (SHA512 shaM = new SHA512Managed())
hash = shaM.ComputeHash(data);
抛出警告
Warning SYSLIB0021 'SHA512Managed' is obsolete:
'Derived cryptographic types are obsolete.
Use the Create method on the base type instead.'
Visual Studio 2022不提供此代码更改功能。如何在.NET 6中使用正确的代码替换它?
该代码由ASP.NET MVC控制器调用。
System.Security.Cryptography.SHA512
创建SHA512 shaM = SHA512.Create()
? - Topaco