How to uniquely encode a vector of non-increasing positive integers
Define $[b_1,\dots,b_n]$ by $b_i = a_i - a_{i-1}$ for $i&gt;1$ and $b_1 = a_1-1$.  Then $[b_1,\dots,b_n]$ is a sequence of non-negative integers.

Pick any unique encoding of such sequences, call it $e^*$, with the property that the output of $e^*([b_1,\dots,b_n])$ is an integer in the range $0..M-1$ for some $M$.

Finally, define an encoding $e$ as follows:

$$e([a_1,\dots,a_n]) = M \times [a_1,\dots,a_n] \cdot [1,2,\dots,n] + e^*([b_1,\dots,b_n])$$

where $[b_1,\dots,b_n]$ is defined as above.  Then the encoding $e$ satisfies both of your conditions.  Encodings are unique (this follows from the uniqueness property of $e^*$).  Also it satisfies the ordering property (this follows since $0 \le e^*(\cdots) &lt; M$).