C# .net core 使用new HMAC***()替代KeyedHashAlgorithm.Create

.net core 中不支持KeyedHashAlgorithm.Create方法,因此可以使用new 来替代。
代码:

//比如要使用HMACSHA1加密方法.
//.net framework下
// var algorithm = KeyedHashAlgorithm.Create("HMACSHA1")
//.net core 下
var algorithm = new HMACSHA1()