Skip to content

Commit

Permalink
refactor: Simplified hash calculation by using static operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaxelr committed Sep 4, 2023
1 parent 6fe5161 commit 8487e0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Carter.Cache/CarterCachingMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -79,8 +78,6 @@ internal static string CalculateChecksum(byte[] content)
return string.Empty;
}

using var sha1 = SHA1.Create();

return Convert.ToBase64String(sha1.ComputeHash(content.ToArray()));
return Convert.ToBase64String(SHA1.HashData(content));
}
}

0 comments on commit 8487e0a

Please sign in to comment.