01 March 2007 - java_dev (original) (raw)

08:50 pm - theycallmesir - Base64 conversion Need some help with some conversions.I have a string of decimal values 85 49 86 18 12 48 195 12 48 195 12 49 194 14 56 195 14 113which I need to convert to 6 bit ASCII values.Taking the first 2 values as an example, if I were to do this by hand this is what it would look like.85 is converted into a hex value of 5555 is converted into a binary value of 0101010149 is converted to a hex value of 3131 is converted into a binary value of 00110001Put the 2 binary values together to get 0101010100110001Taking the first 6 digits of the binary, 010101 converts to a hex value of 1515 in 6 bit Ascii is a U.Take the next set of 6 digets of the binary, 010011 converts to a hex value of 1313 in 6 bit Ascii is an SOk, so after that painful explaination.Are there any Java utils that can do this for me?thanks