Skip to content

Commit a9b1cd3

Browse files
Update HMACUtilities.cs
1 parent 6f691a6 commit a9b1cd3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/ImageSharp.Web/HMACUtilities.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)