2 ms·
Who said you need or want run-to-run hash stability? One common technique for defeating hash collision attacks is maxing a secret random tweak, newly computed o
by quotemstr 8y ago
Who said you need or want run-to-run hash stability? One common technique for defeating hash collision attacks is maxing a secret random tweak, newly computed on each program run, into to hash function. (Python is one environment that uses this trick.) Under this scheme, hash values are unstable, but the world keeps working. Hash stability turns out not to be particularly important most of the time.
Generally speaking, if your program depends on the stability of hash-table enumeration order, you're doing something wrong in the first place.
- delhanty 8y ago>if your program depends on the stability of hash-table enumeration order, you're doing something wrong in the first place The point is not all programs are correct. If you're trying to reproduce a bug that occurs in the release version, but goes away in the debug version (because hash-table enumeration order changes) that makes life more difficult.