Generate numeric or string ID for a sequence of elements
-
05-11-2019 - |
Frage
How to generate a numeric or string id(not very large text) for a sequence of elements where ordering doesn't matter.
Example:
[41,1001,32]
should generate the same ID as [32,1001,41]
[41,1001,32, 5]
should be different.
Elements could be hundreds where each individual ID can be a 4/5-digit number.
I thought about sorting, concatenate and Hash/Compress the string, but are there gonna be a lot of collisions ?
Any ideas would be much appreciated.
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit cs.stackexchange