Implement a really simple proof-of-work algorithm.
iterations_needed = Pow.count(value, difficulty)
The implementation is similar to HashCash and BitCoin.
-
Set a counter to 1.
-
Do
value = SHA256(value)
. If the firstdifficulty
bits of the result are zero, return the counter. -
Otherwise increment the counter and go back to 2.
This is simply to provide a slightly real world synthetic CPU load.