This is the line in
xmr-stak where the hash is compared to the target:
if (*piHashVal < oWork.iTarget) executor::inst()->push_event(ex_event(result, oWork.iPoolId));
However, if you look above,
*piHashVal is defined as:
piHashVal = (uint64_t*)(result.bResult + 24);
result.bResult is the whole hash (a 32 byte long array), and it's just using the last 8 bytes of it.
Why not compare all 32 bytes to the target? And why is it comparing only the last 8 bytes? Does this mean that the code is little endian only?