Skip to content

Commit c5ca516

Browse files
authored
Fix regression in RegexGenerator.GetSHA256FieldName (#101606)
A previous refactoring deleted the use of the hash.
1 parent 9892d46 commit c5ca516

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5405,7 +5405,7 @@ private static string GetSHA256FieldName(string prefix, string toEncode)
54055405
{
54065406
#pragma warning disable CA1850 // SHA256.HashData isn't available on netstandard2.0
54075407
using SHA256 sha = SHA256.Create();
5408-
return $"{prefix}{ToHexStringNoDashes(Encoding.UTF8.GetBytes(toEncode))}";
5408+
return $"{prefix}{ToHexStringNoDashes(sha.ComputeHash(Encoding.UTF8.GetBytes(toEncode)))}";
54095409
#pragma warning restore CA1850
54105410
}
54115411

0 commit comments

Comments
 (0)