I've got a route that contains objects. Each one has value 0 or 1. I need unique route ID which will identify any objects order. Currently I'm doing it using binary number that is converted to decimal (see picture).
The problem is, that amount of objects in route is up to 15. So, decimal number will be very big (up to 32767) with many values, that will never be used.
How to convert that number, to another unique value, but much smaller (<255)? I need to do that, only by using simple arithmetical operators (+,-,*,div).