title: Compress(encrypt) string with alphanumeric & special characters to alphanumeric and convert back the compressed alpanumeric to original string
body: <p>I have a string ex: "12345678923|asdd-asda-sdas-dasd-asdd-asda-sdas-dsdd" (length >50), I am passing this string to an API-X which consumes the string and returns the same string in callBack API-Y. <bR><br>But API-X doesn't support the input string with following conditions.
  <br>
  1.Length should be less than 40.<br>
  2.No special characters allowed.<br>
  3.It can be alpha numeric.<br></p>
  
  <p>I am expecting the same string as input to my API-Z from the callBack API-Y. I can't change the behavior of API-X as it is vendor API.</p>
  
  <p>I tried following approaches to achieve this scenario but none of them satisfy all 3 conditions.<br>
  <br>
  1.convert all special characters to alphanumeric to satisfy condition (2) and (3), But Condition (1) will fail as the converted string length is crossing 100 characters.<br>
  2.convert string to byte array and byte array to string. Which is again failing condition (1)<br>
  3.Thought to zip the string and unzip, But this fails condition (2) and (3)<br>
  <br>
  Please suggest some algorithm to achieve this.
  <br>
  Thanks in advance.</p>