I'm working on my miner for my "game" site that's basically a pre-image attack from a hash posted online. You submit a hash input, it's hashed, and your score is the hamming distance (the number of bits that differ) between the two values. If it matters, I'm using Skein-1024 v1.3

My miner up until now has been incrementing a value and hashing it. Increment, hash, increment, hash ad infinium. I wrote it so that when I close the miner, it saves it's current highest value that way when I restart it I won't start back over at 1 and hash all the same inputs again. I can pick up where I left off. This has proven to be some what successful. However, I'm curious if the miner might be more fruitful by generating random numbers instead of incrementing.

It seems to be a hard metric to measure. I know that most hashes will output wildly different values if their inputs are off by only a bit or two, but I feel that by incrementing the value I hash I'm usually only a few bits off. If I randomly generate values I'll probably do fewer hashes (because random number generation is more intensive than a simple num++ increment) but my gut tells me that I'll have a more diverse set of inputs and that it might produce a more diverse set of outputs. I know not to trust my gut without reason about this. I feel crazy just typing it out.

I also know that if I increment I'll never end up hashing the same value twice. Random is capable of that although the odds of generating the exact same 64 bit number twice is slim.

Can I expect different qualities of outputs from my miner by hashing random values instead of an incrementing value?

FULL DISCLOSURE: I am the owner and operator of the site above. There are no ads or even analytics on the page.

1 Answer 1


I'm not familiar enough with Klein, but if you're using a strong cryptographic hash function, then correlations in the input should not translate to any correlation in the output. So using incremental input vs random numbers shouldn't make any difference, at least in theory.

Of course any weakness in the hashing function may mean that this is not the case.

However, if you are not the only person searching then you want to avoid searching on places that many other people have searched through. You are less likely to find a better solution than the current best solution if you are searching through parts that have been extensively explored. Many people probably also starts the search incrementally starting with 1, which is a highly explored range, so you want to avoid increment from 1. You would want to start the search with a random number, then keep incrementing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .