Use a hashtable.
Every unit is really just an integer anyway.
Custom script: set udg_YourIntegerVariable = GetHandleId(udg_YourUnitVariable)
That will give you the "codebar" of the unit.
That worked! Ty!
Just to go on a bit further with the topic.
I was thinkin about some kind of method to transform the Unit ID into a value between 0 and 8190 with some math formula. Could there be a way to do it efficiently and to retrieve the data by applying a reverse-math?
The thing is Wc3 already indexes unit, and I'm pretty sure that transforming that ID keeping it's unrepeatable-ness with a simple formula is better than a whole indexing system.
Every unit is really just an integer anyway.
how can simple integer move around the map and fight other integers?
The fact that it has HandleId doesnt mean its integer, its some complex data type which inherits some other complex data type called widget and that inherits handle(you know that)