Well.. Each couple of characters in a guid is the hex encoded representation of a byte. Depending on the chosen encoding for the target, you should be able to convert each n bits of the original stream (which should be 32 characters and NOT 36, giving a total of 32/2*8=128 bits) into a somewhat compressed representation. To me, the simplest thing to do would be to encode the 128 bits stream by 7 bits chunks, obtaining a final string which contains only printable characters (ASCII 7 bit); I don't know the requirements for your encoding, so I suppose this should work well enough... The result should be a string of 19 characters (the last chunk of the 128 bit stream should have been padded accordingly to be 7 bit in length).
HTH Efran Cobisi, cobisi.com Hevel, Shawn wrote:
I've got a Guid 36 positions long. I need a way to encrypt this and decript this value. When I encrypt the value the length can be no longer than 30 positions. Is there a way to encrypt the Guid into a length of 30 and decript is back to a length of 36, without losing the original value of the Guid? I'm using a third party software and the field I want to store this in is only 30 positions long. Thanks for the help. Shawn Hevel, API, AIT Lead Programmer Analyst Information Technology Department South Carolina Farm Bureau Insurance Companies Phone: (803) 936-4331 Fax: (803) 936-4629 Work Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Home Email: [EMAIL PROTECTED] =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
