Encoding 0 to 255(1 Byte) range of 10 different values into 3 Byte length value and retrive it to original values

177 views Asked by At

I need to solve the problem:

I have 10 different bytes(2^8) and each byte value range is 0 to 255. It needs to encode into 3- bytes(2^24) length. Later I need to retrieve the original values from encoded 3-byte values.

I tried Cantor and Szuszik functions but the encoded value is exceeding the 3 Byte length.

Is there any other alternative way to solve this problem in Maths or Computer Science/binary logic?

0

There are 0 answers