Looking for an algorithm to generate int 0- 255 when provided with an arbitrary pair of numbers between 1 - 99 (upper limit can be you your choice) This is intended to uniquely number the links between a mesh of an arbitrary number o nodes (for my needs anywhere between 1 and 50 is OK. The upper limit can be your choice as long as it is higher than 9. 
Here are my requirements:
-the result must be an integer between 0 and 255
-the result must be unique in the sense that each pair of numbers shall result in a unique number (call it link ID)
-the input data is a pair of numbers between 1 and X where X can be between 1 and  100. (you can change that to any number higher than 9, the higher the number the better)
-the result must be intuitive in the sense that if I look at the input pair I should be able to guess     
Here is an example:
A1 A2 A3 A4 are the nodes
The A1A2 link will be 12
A3A2 link will be 23   
Algorithm: take the node indexes arrange them in an ascending order and you have your Link ID
The problem appears when I try to use the above for numbers higher than 10 because A8A10 will be 810 which is greater than 255
Note: I am fine for nodes from 1 to 9. I need solutions for more than 9 nodes
 A: If you have $23$ nodes then there are $\binom{23}{2} = 253$ possible links,
assuming that any node may be linked to any other.
If you had $24$ nodes there would be $\binom{24}{2} = 276$ possible links,
so $23$ nodes is the most you can have if every pair of nodes must have
a unique integer identifier $n$ in the range $0 \leq n \leq 255$.
Number the links as follows: for nodes $A_x$ and $A_y$, let
$v = \max\{x,y\}, u = \min\{x,y\}.$
In other words, the nodes are identified as nodes number $u$ and $v$
with $1 \leq u < v \leq 23$.
Then let the link between these nodes be identified by
$$
L(u,v) = \frac12(v-1)(v-2) + u - 1.
$$
For example, if we link nodes $A_1$ and $A_2$, which are the lowest-numbered possible pair of nodes, the link is link number
$L(1,2) = \frac12(2-1)(2-2) + 1 - 1 = 0$, the lowest possible link number.
If we link nodes $A_{22}$ and $A_{23}$, which are the highest-numbered possible pair of nodes, we get link number
$L(22,23) = \frac12(23-1)(23-2) + 22 - 1 = 252$.
Some other nodes and their link numbers are:
\begin{align}
A_1    &&& A_3    & L(1,3) &= 1 \\
A_2    &&& A_3    & L(1,3) &= 2 \\
A_1    &&& A_4    & L(1,3) &= 3 \\
A_3    &&& A_4    & L(1,3) &= 5 \\
A_1    &&& A_5    & L(1,3) &= 6 \\
A_1    &&& A_{21} & L(1,21)  &= 190 \\
A_{20} &&& A_{21} & L(20,21) &= 209 \\
A_1    &&& A_{22} & L(1,22)  &= 210 \\
A_{21} &&& A_{22} & L(21,22) &= 230 \\
A_1    &&& A_{23} & L(1,23)  &= 231 \\
\end{align}
The reasoning behind this formula is that there are 
$\binom{v-1}{2} = \frac12(v-1)(v-2)$ pairs of nodes where both
nodes have node numbers less than $v$, and these will get node numbers
$0$ through $\frac12(v-1)(v-2) - 1$, inclusive;
then the pair $A_1$, $A_v$ will get the next link number,
$\frac12(v-1)(v-2)$, 
the pair $A_1$, $A_v$ will get link number $\frac12(v-1)(v-2) + 1$,
and so forth up to $A_{v-1}$, $A_v$,
which gets link number $\frac12(v-1)(v-2) + v - 2 = \frac12 v(v-1) - 1$.
A: For x,y in [1..10] you could map AxAy to 10M+m, where M=max(x,y) and m=min(x,y)
-This yields a number in [11..110] which is guaranteed in [0..255]
-AxAy maps to the same number as AyAx since changing order doesn’t affect max or min
-Distinct unordered (x,y) pairs always map to different numbers (since they must differ in either max or min, and per the formula no distinct (max,min) pairs map to the same number)
-It’s ez to compute mentally
