Compressing two integers disregarding order
Yes, one can.  If $x&lt;y$, map the set $\{x,y\}$ to the number

$$f(x,y) = y(y-1)/2 + x.$$

It is easy to show that $f$ is bijective, and so this can be uniquely decoded.   Also, when $0 \le x &lt; y &lt; 2^{32}$, we have $0 \le f(x,y) &lt; 2^{63} - 2^{31}$, so this maps the set $\{x,y\}$ to a 63-bit number $f(x,y)$.  To decode, you can use binary search on $y$, or take a square root: $y$ should be approximately $\lfloor \sqrt{2 f(x,y)} \rfloor$.