To be honest, I don’t know how to properly title this problem in one short sentence.
But I will try to explain the challenge I would like resolve.
However, first an example of the concept, on binary number, to better understand the problem.
Lets say we have an int, made of 32 bits.
Each bit takes value of course 0, or 1.
If we set some bits and we want to get unique sum of element, we can get for example
1001 0000 1011 …
For this example I take first 4 bits from the left 1001.
Unique value after conversion to decimals, is 1 + 8 = 9.
There is no other combination, which will give 9.
Similarly applies for all 32 bits.
Now, what I would like to find out, if there is some way, in which I could apply same unique sum of elements concept as in binary, for array of 125 elements, rather 32 and where each element can take not 0 to 1, but 0 to 1023 for example.
Obviously, I can not use same principle as with binary to decimal conversion, as I would have not enough numbers, to cover all combinations.
Then I was thinking, something like that, if considering flowing number:
8010 0103
Then I could multiply each element index by 10, for each corresponding index.
8+010 + 0+110 + 1+210 + 0+310 + 0+410 + 1+510 + 0+610 + 3+710
= 8 + 10 + 21 + 30 + 40 + 51 + 60 + 70
= 290
But that is 290. Of course, 290 can be achieved by different combination of values. Then when comparing both cases, I would have result that both sequences are equal. Which is not true.
So that is no go.
Only other way I can think of, is hash.
I loose this way ability, to compare by value.
But If I can guarantee, that given combination of array values, will it give always same hash of the array?
Would that be true? I think that is only valid per game session, however.
Probably selecting type of collection (array, List, NativeArray, DynamicBuffer, … ), is less relevant is such application, as long I could get hash value.




