not sure if this is possible but in python there is a hash() function which takes a string or an integer and generates a [EDIT not-unique] integer representation of that input.
My question is (after searching online), how to reverse the generated integer back into the original String.
Thanks.
You can't theoretically do that, at least not in an efficient manner (read: "in reasonable time"), even if the hash is not cryptographically secure.
Now if your search space is small enough (say, for example, if the only possible input is a list of 1000 words), you might pre-compute a sorted table of all possible hashes (as a key) and their corresponding inputs and perform a O(log(n))
a lookup on that.
This would of course give you a list of possible results, as hashes are not unique. Now, again, if your search space is small enough, you may only have unique results for each and every input. But we can't say anything sure about it unless we know more about the source of your data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With