I don't think such hash exists, regardless of the programming language.
Here is a quote from the hash function wikipedia page:
A hash function is any function that can be used to map data of arbitrary size to data of fixed size.
It means that you have a fixed set of values, e.g. a 6 character long hash can store 16^6
different values. However, you can create the hash value of any string. So a hash function maps potentially infinite different values to a fixed sets of values. Hence there will be collisions. So you cannot tell just by the hash value which was the right original value.
A simplistic example from an imaginary hash function: John
maps to abc
. Jane
maps to ghi
. Doe
also maps to abc
. So when you see abc
as a hashed value, where did that come from? Was it John
? Was it Doe
?