IHow to get value of original value of hashcode

hashcode, java

Solution

No, there is no such method. The hash function is lossy.

When you think about it, the set of all possible strings is much larger than the set of all possible ints, making a two-way mapping impossible.

If it were possible to recover the string from its hash code, that would enable one to compress an arbitrary amount of data into a single `int`, and then to be able to perfectly reconstruct it.

Problem

I have the hashcode of a string, and now I want to get the original string back. Is there any method available for this?

Original source