Hash algorithms are designed to run one-way (data to hash). This is why we often stored hashed passwords in a database and not encrypted passwords (which can be decrypted). It's just about impossible for a hacker to convert a hashed password back to the original password.
Rewrite your function to not use a hash algorithm.