How to compress an hexadecimal number into a short string?