3

Base85 ASCII Encoder/Decoder

LOOK HERE FOR INTIAL REFERENCE ->> Base85 Wikipedia Page

I am making a Base85 encoder/decoder for java, I don't want the answer or solution to my programming or code from a complete encoder. I can provide sources from my code, but it is unnecessary, as this question is more geared to understand the concept. I included all the steps outlined on that wikipedia page in my code successfully up to the 32-bit Value point, where the total value of the 32bit in base 10 is converted to base85.

LOOK HERE ->> Base85 Encoding Table

So, to be specific, I have successfully gotten the number 1298230816 - but now I'm stumped. How do I get the numbers represented in base 85 as shown above? (24*85^4; 73*85^3; 80*85^2; 78*85; 61). What mathematical process would I go about to find those values?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Logik
  • 41
  • 5

1 Answers1

2

It is not entirely clear what you are asking, but I'm guessing that you want to know how to compute a, b, c, d, e such that N = a * 85^4 + b * 85^3 + c * 85^2 + d * 85 + e.

The answer is:

  1. Take N remainder 85 to give you e.
  2. Divide N by 85.
  3. Repeat for d, c and so on.
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Thanks! That is exactly what I was looking for. I figured it out almost as soon as your began using remainders. – Logik Nov 10 '12 at 02:35