Content
@
https://warpcast.com/~/channel/python
0 reply
0 recast
0 reaction
Mikko
@moo
TIL Python hash() function is not stable between Python runs, but not even in the multiprocessing. Python hash() is non-deterministic to avoid dictionary stuffing attacks in web servers https://thepythoncorner.com/posts/2020-08-21-hash-tables-understanding-dictionaries/ However Python hash function seems to be also unstable in multiprocessing: in certain scenarios subprocesses generate different hashes. For persistent hashes (cache) and communications use hashlib.md5() or hashlib.sha()
0 reply
0 recast
2 reactions