Question

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?

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top