ORD_u) { return $this->error('Illegal character in ASCII85Decode.'); } $chn[$state++] = $ch - ORD_exclmark; if ($state == 5) { $state = 0; $r = 0; for ($j = 0; $j < 5; ++$j) { $r = $r * 85 + $chn[$j]; } $out .= chr($r >> 24); $out .= chr($r >> 16); $out .= chr($r >> 8); $out .= chr($r); } } $r = 0; if ($state == 1) { return $this->error('Illegal length in ASCII85Decode.'); } if ($state == 2) { $r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85; $out .= chr($r >> 24); } elseif ($state == 3) { $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85; $out .= chr($r >> 24); $out .= chr($r >> 16); } elseif ($state == 4) { $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ; $out .= chr($r >> 24); $out .= chr($r >> 16); $out .= chr($r >> 8); } return $out; } public function encode($in) { return $this->error("ASCII85 encoding not implemented."); } } }