I've been looking at the code for a LTC miner written in java(https://github.com/pooler/JMiner). And have a question
Is the way he compares the target and hash correct? I thought you had to compare them as numbers not individual bits
Code:
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 true;
The whole code https://github.com/pooler/JMiner/blob/master/src/org/litecoinpool/miner/Work.java