Hash of integers for use in Random module

Will McGugan news at NOwillmcguganSPAM.com
Sun Mar 6 10:10:36 EST 2005


Hi,

If I retrieve the hash of an integer, will it always return the same 
value across platforms?

This reason I ask is that I want to produce a sequence of pseudo random 
numbers using the random module, that I can re-create later on. So I'll 
need to store the seed value, but Random.seed takes a hashable object 
rather than an integer directly.

Which brings another question to mind. Are hashes of builtin objects in 
general consistent across platforms, or are they an implementation 
detail that could change?

TIA,

Will McGugan



More information about the Python-list mailing list