For any $v$ many $b$-bits vectors $(\mathbf{x}_0, \mathbf{x}_1, \ldots, \mathbf{x}_{v-1}) \in \{\{0, 1\}^b\}^v$, what's the fastest way to combine $\mathbf{x}_0, \mathbf{x}_1, \ldots, \mathbf{x}_{v-1}$ into a single number, such that the operation is order-sensitive?
E.g. say that $\hat+$ is some method of combining numbers (not necessarily addition, but we can define it however we want). The goal is to have $\mathbf{x}_0 \hat+ \mathbf{x}_1 \hat+ \ldots \hat+ \mathbf{x}_{v-1}$ result in a unique number different than any other order, such as, $\mathbf{x}_{v-1} \hat+ \mathbf{x}_{v-2} \hat+ \ldots \hat+ \mathbf{x}_0$.
As for fastest, speed is measured on general purpose CPUs. E.g. x86-64.
My thought so far is:
b_bits_variable xor = 0;
for (i = 0; i < v; i++) {
xor = xor ^ (xor + x_i);
}
where:
b_bits_variableis a variable that has exactly $b$ many bits. E.g. if $b=16$, then we may useuint16_tin the C programming language.vis $v$ (quantity of vectors as in question above).x_iis $\mathbf{x}_i$ (a vector among the $v$ many ones as in question above).i++$= i+1$.^is bit-wise XOR.+is addition as commonly used in programming languages, which overflows if number is larger than $2^b - 1$. I think such overflow is basically modulo $2^b$ addition. I.e.xor + x_i$=\text{xor} + \mathbf{x}_i \mod 2^b$.