Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is String.hashCode() guaranteed across JVMs?

807569Aug 23 2006 — edited Aug 23 2006
I know this has been asked and I'm sorry. I've probably asked it myself but have forgotten the answer.

Given a US based character set is String.hashCode() guaranteed to return the same value for the same string across JVMs? I know that hashCode() can return the same value for different strings. I want to implement it in an update system where the client hashes it's value and sends it to the server. The server compares the hash (different JVMs) and if different sends a new value.

I'm choosing this methodology because the value being tested is very large. I figure the chances of a false positive (where the client and server value don't match but the hash does) to very low.

Thanks for your input(s)
ST
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2006
Added on Aug 23 2006
12 comments
2,047 views