Compare commits

..

No commits in common. "master" and "v1.0.3" have entirely different histories.

View File

@ -216,10 +216,6 @@ func (h *Hashcash) Verify(subject string) error {
}
func verifyBits(hash []byte, bits, n int) bool {
if 0 == bits {
return true
}
for i := 0; i < n; i++ {
if bits > 8 {
bits -= 8
@ -231,12 +227,15 @@ func verifyBits(hash []byte, bits, n int) bool {
// (bits % 8) == bits
pad := 8 - bits
if 0 == hash[i]>>pad {
return true
if 0 != hash[i]>>pad {
return false
}
return true
}
return false
// 0 == bits
return true
}
// Solve will search for a solution, returning an error if the difficulty is