Wagner is offlist so I have to through out a challenge to anyone bored over the holidays: Has anyone out there tried to encode binary data to text for transmission through text only systems (like uuencode, binhex, base64, quote-printable, etc...) using the entire 96 ASCII printable characters rather than the 64 (or less) that are used in these system? If you think of a string of bytes as a base 256 number of multiple digits (each digit has a value from 0 to 255 and there are bytes # of digits) and you modulo that entire number by 96 then integer divide it by 96 until it is zero, recording the modulo each time, you have a string of base 96 numbers that you can transmit to the remote system. When the entire string is received, you can multiply the last base 96 digit by 96 and add the next then multiply that result by 96 and add the next until all the base 96 digits are used and then you will find that you have the original number or string of bytes. The point of this is that your "mime" encoding will increase the data size by less if you use 37.5% of the possible values rather than just 25% of them. The increase should be about 12.5% less, no? Well... no because on a PIC (and everywhere else to some degree) there is a practical limit to how large the number can be. By my calculations, limiting your self to 16 bytes at a time drops the improvement down to about 7%. I had hoped to avoid that by develop a system for doing it on the fly, by knowing that a base 256 digit requires 8 bits and a base 96 digit requires 6.584962500721156 bits. If I put out accum mod 96 and set accum to int(accum / 96) then I have reduced the amount of data in the accum by 6.58... and when I have less than that amount in the accum I need to get the next byte of source data, set accum to accum * 256 + the byte and increase the variable tracking the amount of data being carried by 8. I never have to accumulate the entire input string. This produces a valid stream of data... I've verified that. However, I just can't wrap my brain around a way to do the same thing without having to accumulate the entire source data string prior to outputting it on the remote end. Questions: A) Can this be done? B) If not, why not? C) If it can, is there any other reason besides extra work that you wouldn't want to? James Newton mailto:jamesnewton@geocities.com phone:1-619-652-0593 http://techref.homepage.com NOW OPEN (R/O) TO NON-MEMBERS! Members can add private/public comments/pages ($0 TANSTAAFL web hosting)