tags:

views:

130

answers:

1

Dear ladies and sirs.

I need to convert an array of bytes to another base, namely 85. In math terms the question is how to convert from base-256 to base-85 in the most efficient way?

This question is inspired by my previous question - http://stackoverflow.com/questions/2827627/what-is-the-most-efficient-way-to-encode-an-arbitrary-guid-into-readable-ascii-3

Thanks.

+1  A: 

You mean like this? http://www.codinghorror.com/blog/2005/10/c-implementation-of-ascii85.html

In silico
Looks like we did the same thing, only our input is always a byte array representing some guid, so we were able to optimize the solution by encoding two UInt64 values representing the guid into two 10 byte base-85 strings. But otherwise, this is the same code. Good to know.
mark