Minor correction of base85x encoding

In the transformation between base 85 values and ASCII characters there was a minor mistake last time. 40 minus 2 is 38 of course, not 39.

The corrected formulars are

From base 85 to ACSII
out = (c >= 51 ? c+42 : (c >= 22 ? c+41 : (c >= 2 ? c+38 : c+36)));

From ASCII to base 85
c = ((in >= 93) ? in-42 : ((in >= 63) ? in-41 : ((in >= 40) ? in-38 : in-36)));

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.