Is it possible to losslessly compress 32 hexadecimal numbers into 30?

For example, it is possible to compress

002e3483bbdc11ddaae0754822a559f6 into something that is 30 characters or less.

+3


source to share


2 answers


Yes, you can convert it to a base number of 32, so the largest 32 digit hex number, i.e. ffffffffffffffffffffffffffffffff, is equivalent to 80000000000000000000000000 in base 32, which has only 26 characters, also note that in base 32 you end up with a string containing only the following characters: 123456789ABCDEFGHIJKLMNOPQRSTUV



For example: 002e3483bbdc11ddaae0754822a559f6 - 5OQ87EUS27F0000000000000 in base-32

+4


source


If your question is to compress 32 hex numbers into 30 hex numbers.

This is not possible for all test cases, since if it was possible, multiple 32-line hex strings would have to shrink to the same 30-line hex string, so you wouldn't know which one was ( the pigeon principle ).



The proof is less compelling - you can repeatedly call the process on any file size to go to a single 30-line hex line, which doesn't make much sense.

Here is the article I just found. Wikipedia says something similar.

+1


source







All Articles