Corrected checksum calculation errors.

This commit is contained in:
2017-06-29 22:30:03 +01:00
parent 08cbe92709
commit 4620115967
5 changed files with 23 additions and 14 deletions

View File

@@ -153,8 +153,9 @@ namespace DiscImageChef.Checksums
for(int i = 0; i < fileStream.Length; i++)
localhashInt = (localhashInt >> 8) ^ localTable[(ulong)fileStream.ReadByte() ^ localhashInt & 0xffL];
localhashInt ^= crc64Seed;
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
hash = BitConverter.GetBytes(localhashInt);
hash = BigEndianBitConverter.GetBytes(localhashInt);
StringBuilder crc64Output = new StringBuilder();
@@ -209,8 +210,9 @@ namespace DiscImageChef.Checksums
for(int i = 0; i < len; i++)
localhashInt = (localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff];
localhashInt ^= crc64Seed;
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
hash = BitConverter.GetBytes(localhashInt);
hash = BigEndianBitConverter.GetBytes(localhashInt);
StringBuilder crc64Output = new StringBuilder();