An interesting problem has recently appeared. We came across some code that uses hashCode() as a source of salts for MD5 encryption, but this begs the question: will hashCode() return the same value for the same object on different virtual machines, different versions of JDK and operating systems? Even if this is not guaranteed, has it changed at any moment so far?
EDIT: I really mean String.hashCode() , not the more general Object.hashCode() , which of course can be overridden.
java hashcode
cletus
source share