Originally posted by Anthony Alberts:
I am using the String method hashCode() to obtain the hash value of a specified String. I need to to convert the hash value back to the original String. Can anybody help? Essentialy this should be simple but I am stumped!
It's not only not simple, it's impossible!
First, there is no guarantee that two different Strings also differ in their hashcode. In fact there *have* to be Strings which are not equal but share the same hashcode - after all, there are much more possible values for a String than possible values for an int!
Second, there is no guarantee on how the hashcode of a String is calculated, afaik - the algorithm might very well differ strongly between JRE implementations.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus