{
for (int i = hash.Length - 1; i >= 0; i--)
{
if ((hash[i] & 0xff) > (target[i] & 0xff))
return false;
if ((hash[i] & 0xff) < (target[i] & 0xff))
return true;
}
return false;
}
That should work except that the equal case should return true instead of false. The hash is treated as a little-endian number and you have accounted for that as long as the target is a little-endian number.
When it comes to pools, there is some terminology overlap -- there are Bitcoin difficulty and Bitcoin target, and share difficulty and share target.
For most pools, the share difficulty is assigned to you or you choose it. Then you must divide the bitcoin target by the pool's max share difficulty and then multiply it your share difficulty to get your share target. Your submit a hash when it is less than your share target.