Skip to content

Commit

Permalink
Fix NonCryptoHashTestDriver.AssertEqualHashNumber for big endian (#79135
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Dec 2, 2022
1 parent 2905df7 commit 47e26b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private void VerifyEmptyResult(ReadOnlySpan<byte> result)

protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEndian = false)
{
if (littleEndian == BitConverter.IsLittleEndian)
if (littleEndian)
{
hash = BinaryPrimitives.ReverseEndianness(hash);
}
Expand All @@ -306,7 +306,7 @@ protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEn

protected static void AssertEqualHashNumber(string hex, ulong hash, bool littleEndian = false)
{
if (littleEndian == BitConverter.IsLittleEndian)
if (littleEndian)
{
hash = BinaryPrimitives.ReverseEndianness(hash);
}
Expand Down

0 comments on commit 47e26b2

Please sign in to comment.