Endian typoness

This commit is contained in:
2015-02-02 18:47:55 +00:00
parent e450520c48
commit 066ac09a86
2 changed files with 10 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ namespace DiscImageChef.Checksums
public byte[] Final()
{
hashInt ^= crc64Seed;
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
return BigEndianBitConverter.GetBytes(hashInt);
}
@@ -108,6 +109,7 @@ namespace DiscImageChef.Checksums
hashInt ^= crc64Seed;
StringBuilder crc64Output = new StringBuilder();
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
for (int i = 0; i < BigEndianBitConverter.GetBytes(hashInt).Length; i++)
{
crc64Output.Append(BigEndianBitConverter.GetBytes(hashInt)[i].ToString("x2"));
@@ -155,6 +157,7 @@ namespace DiscImageChef.Checksums
for (int i = 0; i < fileStream.Length; i++)
localhashInt = (localhashInt >> 8) ^ localTable[(ulong)fileStream.ReadByte() ^ localhashInt & (ulong)0xff];
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
hash = BitConverter.GetBytes(localhashInt);
StringBuilder crc64Output = new StringBuilder();
@@ -208,6 +211,7 @@ namespace DiscImageChef.Checksums
for (int i = 0; i < len; i++)
localhashInt = (localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff];
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
hash = BitConverter.GetBytes(localhashInt);
StringBuilder crc64Output = new StringBuilder();
@@ -232,3 +236,4 @@ namespace DiscImageChef.Checksums
}
}