none
Encrpyt and decrypt to a shorter string RRS feed

  • Question

  • Hi Experts,

    I want to compress a alphanumeric string of 10 (or may be 15 chanractors) string to five charactor alphanumeric string.. I should also get back the original string upon decompression... can you provide me any idea or code to help me out..

    Monday, October 13, 2014 1:44 PM

Answers

  • That is not going to be possible if the range of characters you are calling alphanumeric is the same for the uncompressed string as for the compressed string.

    You would need to be able to use twice as many characters in the compressed sting as the uncompressed string to be able to compress from a length of 10 to a length of 5. For example if the uncompressed string contained only upper case letters (A-Z), it would be possible to compress a string of length 10 to a string of mixed case letters (a-z, A-Z) of length 5.

    Monday, October 13, 2014 2:37 PM

All replies

  • That is not going to be possible if the range of characters you are calling alphanumeric is the same for the uncompressed string as for the compressed string.

    You would need to be able to use twice as many characters in the compressed sting as the uncompressed string to be able to compress from a length of 10 to a length of 5. For example if the uncompressed string contained only upper case letters (A-Z), it would be possible to compress a string of length 10 to a string of mixed case letters (a-z, A-Z) of length 5.

    Monday, October 13, 2014 2:37 PM
  • Hi,

    will that be possible to compress to 5 digit but upper case charecters only with any custom algorithm ?

    Tuesday, October 14, 2014 12:47 PM
  • Hi  Amit,

    I do not think there are readily available apis could implement that. You might need to implement that by designing yourself algorithm.

    Regards.

    Thursday, October 16, 2014 3:36 AM