Along the lines of How to map 256 unique strings to 256 unique but effectively arbitrary integers, I am wondering how to generate basically a hashing function. For this question I am wondering if there is a way to perform non-reversible simple operations on integers, such that the resulting output value is always an integer, given two integers as input. So for example, $1 + 2 = 2 + 1$ is reversible. Same with $2 * 3 = 3 * 2$. But while $3 / 2 \neq 2 / 3$, the output values are not integers.

So if there was such an operation, then you could do this:

$3 \circ 2 = 5 \neq 2 \circ 3 = 8$

Something along those lines. Wondering if anything like this exists or where to look for related information. The modulus seems like it might be closely related.


closed as unclear what you're asking by Lord Shark the Unknown, mrtaurho, José Carlos Santos, ancientmathematician, metamorphy Feb 6 at 13:53

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Like subtraction, for instance? $\endgroup$ – Lord Shark the Unknown Feb 6 at 4:16
  • $\begingroup$ Subtraction is good, but I am wondering for an array of possible types of operations, something with some substance. $\endgroup$ – Lance Pollard Feb 6 at 4:17