Fix previous fix

This commit is contained in:
Jérôme Leclercq 2023-09-08 14:00:52 +02:00 committed by GitHub
parent 18efb2016d
commit 5203a4fb49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ namespace Nz
ByteArray CRC32Hasher::End() ByteArray CRC32Hasher::End()
{ {
m_crc = HostToLittleEndian(m_crc ^ 0xFFFFFFFF); m_crc = BigEndianToHost(m_crc ^ 0xFFFFFFFF);
return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 4); return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 4);
} }

View File

@ -38,7 +38,7 @@ namespace Nz
m_sum1 = (m_sum1 & 0xFF) + (m_sum1 >> 8); m_sum1 = (m_sum1 & 0xFF) + (m_sum1 >> 8);
m_sum2 = (m_sum2 & 0xFF) + (m_sum2 >> 8); m_sum2 = (m_sum2 & 0xFF) + (m_sum2 >> 8);
UInt16 fletcher = BigEndianToHost((m_sum2 << 8) | m_sum1); UInt16 fletcher = BigEndianToHost(UInt16((m_sum2 << 8) | m_sum1));
return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2); return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2);
} }