@@ -30,8 +30,7 @@ public static class HMACUtilities
3030 /// <returns>The hashed <see cref="string"/>.</returns>
3131 public static unsafe string ComputeHMACSHA256 ( string value , byte [ ] secret )
3232 {
33- // TODO: In .NET 6 we can use single instance versions
34- using var hmac = new HMACSHA256 ( secret ) ;
33+ using HMACSHA256 hmac = new ( secret ) ;
3534 return CreateHMAC ( value , hmac ) ;
3635 }
3736
@@ -46,7 +45,7 @@ public static unsafe string ComputeHMACSHA256(string value, byte[] secret)
4645 /// <returns>The hashed <see cref="string"/>.</returns>
4746 public static unsafe string ComputeHMACSHA384 ( string value , byte [ ] secret )
4847 {
49- using var hmac = new HMACSHA384 ( secret ) ;
48+ using HMACSHA384 hmac = new ( secret ) ;
5049 return CreateHMAC ( value , hmac ) ;
5150 }
5251
@@ -61,7 +60,7 @@ public static unsafe string ComputeHMACSHA384(string value, byte[] secret)
6160 /// <returns>The hashed <see cref="string"/>.</returns>
6261 public static unsafe string ComputeHMACSHA512 ( string value , byte [ ] secret )
6362 {
64- using var hmac = new HMACSHA512 ( secret ) ;
63+ using HMACSHA512 hmac = new ( secret ) ;
6564 return CreateHMAC ( value , hmac ) ;
6665 }
6766
0 commit comments