[CLSCompliant(false)]
public static uint GetBitmapHashValue(
Bitmap image)
{
uint result = 0xFFFFFFFF;
for (int x = 0; x < image.Width; x++)
for (int y = 0; y < image.Height; y++)
result =
BitmapHasher.CRCTable[
(result ^ image.GetPixel(x, y).ToArgb()) & 0xFF] ^
(result >> 8);
public static int MemoryCompare2(byte[] b1, byte[] b2)
{
int result = 0;
if (b1.Length != b2.Length)
result = b1.Length - b2.Length;
else
{
for (int i = 0; i < b1.Length; i++)
{
if (b1[i] != b2[i])
{
result = (int)(b1[i] - b2[i]);
break;
}
}
}
return result;
}