mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Endian typoness
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2015-02-02 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* Checksums/CRC64Context.cs:
|
||||||
|
Endian typoness
|
||||||
|
|
||||||
2015-02-02 Natalia Portillo <claunia@claunia.com>
|
2015-02-02 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* Checksums/CRC32Context.cs:
|
* Checksums/CRC32Context.cs:
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ namespace DiscImageChef.Checksums
|
|||||||
public byte[] Final()
|
public byte[] Final()
|
||||||
{
|
{
|
||||||
hashInt ^= crc64Seed;
|
hashInt ^= crc64Seed;
|
||||||
|
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
|
||||||
return BigEndianBitConverter.GetBytes(hashInt);
|
return BigEndianBitConverter.GetBytes(hashInt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ namespace DiscImageChef.Checksums
|
|||||||
hashInt ^= crc64Seed;
|
hashInt ^= crc64Seed;
|
||||||
StringBuilder crc64Output = new StringBuilder();
|
StringBuilder crc64Output = new StringBuilder();
|
||||||
|
|
||||||
|
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
|
||||||
for (int i = 0; i < BigEndianBitConverter.GetBytes(hashInt).Length; i++)
|
for (int i = 0; i < BigEndianBitConverter.GetBytes(hashInt).Length; i++)
|
||||||
{
|
{
|
||||||
crc64Output.Append(BigEndianBitConverter.GetBytes(hashInt)[i].ToString("x2"));
|
crc64Output.Append(BigEndianBitConverter.GetBytes(hashInt)[i].ToString("x2"));
|
||||||
@@ -155,6 +157,7 @@ namespace DiscImageChef.Checksums
|
|||||||
for (int i = 0; i < fileStream.Length; i++)
|
for (int i = 0; i < fileStream.Length; i++)
|
||||||
localhashInt = (localhashInt >> 8) ^ localTable[(ulong)fileStream.ReadByte() ^ localhashInt & (ulong)0xff];
|
localhashInt = (localhashInt >> 8) ^ localTable[(ulong)fileStream.ReadByte() ^ localhashInt & (ulong)0xff];
|
||||||
|
|
||||||
|
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
|
||||||
hash = BitConverter.GetBytes(localhashInt);
|
hash = BitConverter.GetBytes(localhashInt);
|
||||||
|
|
||||||
StringBuilder crc64Output = new StringBuilder();
|
StringBuilder crc64Output = new StringBuilder();
|
||||||
@@ -208,6 +211,7 @@ namespace DiscImageChef.Checksums
|
|||||||
for (int i = 0; i < len; i++)
|
for (int i = 0; i < len; i++)
|
||||||
localhashInt = (localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff];
|
localhashInt = (localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff];
|
||||||
|
|
||||||
|
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
|
||||||
hash = BitConverter.GetBytes(localhashInt);
|
hash = BitConverter.GetBytes(localhashInt);
|
||||||
|
|
||||||
StringBuilder crc64Output = new StringBuilder();
|
StringBuilder crc64Output = new StringBuilder();
|
||||||
@@ -232,3 +236,4 @@ namespace DiscImageChef.Checksums
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user