Skip to content

Commit 47e26b2

Browse files
authored
Fix NonCryptoHashTestDriver.AssertEqualHashNumber for big endian (#79135)
Fix #78075 (comment)
1 parent 2905df7 commit 47e26b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/System.IO.Hashing/tests/NonCryptoHashTestDriver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ private void VerifyEmptyResult(ReadOnlySpan<byte> result)
297297

298298
protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEndian = false)
299299
{
300-
if (littleEndian == BitConverter.IsLittleEndian)
300+
if (littleEndian)
301301
{
302302
hash = BinaryPrimitives.ReverseEndianness(hash);
303303
}
@@ -306,7 +306,7 @@ protected static void AssertEqualHashNumber(string hex, uint hash, bool littleEn
306306

307307
protected static void AssertEqualHashNumber(string hex, ulong hash, bool littleEndian = false)
308308
{
309-
if (littleEndian == BitConverter.IsLittleEndian)
309+
if (littleEndian)
310310
{
311311
hash = BinaryPrimitives.ReverseEndianness(hash);
312312
}

0 commit comments

Comments
 (0)