Reformatted.

This commit is contained in:
2016-04-19 02:11:47 +01:00
parent 6a8499f8ed
commit f8bc81d4f5
149 changed files with 6983 additions and 6970 deletions

View File

@@ -59,11 +59,11 @@ namespace DiscImageChef.Checksums
hashInt = crc64Seed;
table = new UInt64[256];
for (int i = 0; i < 256; i++)
for(int i = 0; i < 256; i++)
{
UInt64 entry = (UInt64)i;
for (int j = 0; j < 8; j++)
if ((entry & 1) == 1)
for(int j = 0; j < 8; j++)
if((entry & 1) == 1)
entry = (entry >> 1) ^ crc64Poly;
else
entry = entry >> 1;
@@ -78,7 +78,7 @@ namespace DiscImageChef.Checksums
/// <param name="len">Length of buffer to hash.</param>
public void Update(byte[] data, uint len)
{
for (int i = 0; i < len; i++)
for(int i = 0; i < len; i++)
hashInt = (hashInt >> 8) ^ table[data[i] ^ hashInt & 0xff];
}
@@ -110,7 +110,7 @@ namespace DiscImageChef.Checksums
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"));
}
@@ -143,18 +143,18 @@ namespace DiscImageChef.Checksums
localhashInt = crc64Seed;
localTable = new UInt64[256];
for (int i = 0; i < 256; i++)
for(int i = 0; i < 256; i++)
{
UInt64 entry = (UInt64)i;
for (int j = 0; j < 8; j++)
if ((entry & 1) == 1)
for(int j = 0; j < 8; j++)
if((entry & 1) == 1)
entry = (entry >> 1) ^ crc64Poly;
else
entry = entry >> 1;
localTable[i] = entry;
}
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];
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
@@ -162,7 +162,7 @@ namespace DiscImageChef.Checksums
StringBuilder crc64Output = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
for(int i = 0; i < hash.Length; i++)
{
crc64Output.Append(hash[i].ToString("x2"));
}
@@ -197,18 +197,18 @@ namespace DiscImageChef.Checksums
localhashInt = seed;
localTable = new UInt64[256];
for (int i = 0; i < 256; i++)
for(int i = 0; i < 256; i++)
{
UInt64 entry = (UInt64)i;
for (int j = 0; j < 8; j++)
if ((entry & 1) == 1)
for(int j = 0; j < 8; j++)
if((entry & 1) == 1)
entry = (entry >> 1) ^ polynomial;
else
entry = entry >> 1;
localTable[i] = entry;
}
for (int i = 0; i < len; i++)
for(int i = 0; i < len; i++)
localhashInt = (localhashInt >> 8) ^ localTable[data[i] ^ localhashInt & 0xff];
BigEndianBitConverter.IsLittleEndian = BigEndianBitConverter.IsLittleEndian;
@@ -216,7 +216,7 @@ namespace DiscImageChef.Checksums
StringBuilder crc64Output = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
for(int i = 0; i < hash.Length; i++)
{
crc64Output.Append(hash[i].ToString("x2"));
}