Skip to content

Commit

Permalink
Fix regression in RegexGenerator.GetSHA256FieldName (#101606)
Browse files Browse the repository at this point in the history
A previous refactoring deleted the use of the hash.
  • Loading branch information
stephentoub committed Apr 26, 2024
1 parent 9892d46 commit c5ca516
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5405,7 +5405,7 @@ private static string GetSHA256FieldName(string prefix, string toEncode)
{
#pragma warning disable CA1850 // SHA256.HashData isn't available on netstandard2.0
using SHA256 sha = SHA256.Create();
return $"{prefix}{ToHexStringNoDashes(Encoding.UTF8.GetBytes(toEncode))}";
return $"{prefix}{ToHexStringNoDashes(sha.ComputeHash(Encoding.UTF8.GetBytes(toEncode)))}";
#pragma warning restore CA1850
}

Expand Down

0 comments on commit c5ca516

Please sign in to comment.