I have been told Object.hashCode() could return a different hash even if the contents is the same eg an Array [1,2] and that it can't be relied on to validate object consistency. My understanding is the contents of my Array is the same then I will get the same hash back, even on a different jvm?
The reason I ask is that I want to:
- Hash an array of numbers returned by a service call and send that hash down to the web front end
- Send that hash back on submit of a form
- Make a call to the service again hash it and compare this to the hash sent from the front end.
I thought simply doing Array.hashCode() would do the job but I'm now filled with doubt!