Fix Fletcher16 and CRC64
This commit is contained in:
parent
e8ddac4964
commit
18efb2016d
|
|
@ -93,9 +93,8 @@ namespace Nz
|
||||||
|
|
||||||
ByteArray CRC64Hasher::End()
|
ByteArray CRC64Hasher::End()
|
||||||
{
|
{
|
||||||
#ifdef NAZARA_BIG_ENDIAN
|
m_crc = BigEndianToHost(m_crc);
|
||||||
m_crc = ByteSwap(m_crc);
|
|
||||||
#endif
|
|
||||||
return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 8);
|
return ByteArray(reinterpret_cast<UInt8*>(&m_crc), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,12 +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 = (m_sum2 << 8) | m_sum1;
|
UInt16 fletcher = BigEndianToHost((m_sum2 << 8) | m_sum1);
|
||||||
|
|
||||||
#ifdef NAZARA_BIG_ENDIAN
|
|
||||||
fletcher = ByteSwap(fletcher);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2);
|
return ByteArray(reinterpret_cast<UInt8*>(&fletcher), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue