Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/nes-containers.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UnifFile.cs')
-rw-r--r--UnifFile.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/UnifFile.cs b/UnifFile.cs
index 2921b71..f2ad1e6 100644
--- a/UnifFile.cs
+++ b/UnifFile.cs
@@ -638,7 +638,7 @@ namespace com.clusterrr.Famicom.Containers
if (v.Length > 0)
{
sizeUpPow2 = 1;
- while (sizeUpPow2 < v.Length) sizeUpPow2 *= 2;
+ while (sizeUpPow2 < v.Length) sizeUpPow2 <<= 1;
}
md5.TransformBlock(v, 0, v.Length, null, 0);
md5.TransformBlock(Enumerable.Repeat<byte>(byte.MaxValue, sizeUpPow2 - v.Length).ToArray(), 0, sizeUpPow2 - v.Length, null, 0);
@@ -662,10 +662,10 @@ namespace com.clusterrr.Famicom.Containers
if (v.Length > 0)
{
sizeUpPow2 = 1;
- while (sizeUpPow2 < v.Length) sizeUpPow2 *= 2;
+ while (sizeUpPow2 < v.Length) sizeUpPow2 <<= 1;
}
crc32.TransformBlock(v, 0, v.Length, null, 0);
- crc32.TransformBlock(Enumerable.Repeat<byte>(byte.MaxValue, sizeUpPow2 - v.Length).ToArray(), 0, sizeUpPow2 - v.Length, null, 0);
+ crc32.TransformBlock(Enumerable.Repeat(byte.MaxValue, sizeUpPow2 - v.Length).ToArray(), 0, sizeUpPow2 - v.Length, null, 0);
}
crc32.TransformFinalBlock(new byte[0], 0, 0);
return BitConverter.ToUInt32(crc32.Hash.Reverse().ToArray(), 0);