3 ms·
Using cryptographic hashes for "deterministic randomness", i.e. values which are reproducible, but unpredictable beforehand. I've used this for benchmarking, s
by chriswarbo 4y ago
Using cryptographic hashes for "deterministic randomness", i.e. values which are reproducible, but unpredictable beforehand.
I've used this for benchmarking, seeding pseudorandom number generators with the SHA256 of the project's source code. That way, anyone can reproduce the benchmark, but it's hard to "cheat" since tweaking the code (e.g. to favour the current benchmark) will alter the benchmark in an unpredictable way!
- marginalia_nu 4y agoYou really don't need cryptographic hashes for this, as they pose more demands than you actually need at the expense of speed. Something like CityHash or Murmur3 will be more than sufficient.