Are values hashed using KECCAK - 256
uniformly distributed? If I use a KECCAK - 256
hash and then convert it to a number in a range 0 - N
using the modulo operation, would the probability of obtaining any of the numbers in this range be equal to 1/N, or would there be a deviation from the ideal distribution?
blockchain – Distribution of KECCAK-256 Hash Values – In-Depth Statistical Analysis
blockchainhashkeccakstatistics
Best Answer
I came across this paper that looks at using Keccak-256 (the original one that Ethereum uses, not SHA3) as a PRNG. It subjects the output of the hash to a large number of tests of randomness and it passes them all.
Conclusion:
According to the test results, the sequence of bits generated by applying Keccak-256 to successive integers is indistinguishable from random, and thus your modulo approach ought to be fine - i.e. uniformly distributed.