This question's answer explains the situation with Java well. I would like to know what the situation is with Android. Specifically:
Question 1: For a given string, will the hash code always be the same? (Even more specifically, I need a hashcode of a given string to be the same on a user's phone each time the app is opened).
I googled for the source of android's String
and found this, but I'm playing with fire because I don't know the first thing about Android source, if/when it's modified by manufacturers etc.
Question 2: If the answer to 1 is no, then would it be sensible for me to use the hashCode()
code in the source quoted above in my own hashCode() function?