ASCII85 エンコーダ & デコーダ

などにご利用ください。

エンコーダ

#!/bin/sh
exec gs -q -dNODISPLAY -dBATCH -D#!="{2{currentfile 128 string readline pop pop}repeat}" -- $0 "$@"

/in (%stdin)(r)file def
/out (%stdout)(w)file /ASCII85Encode filter def
{
    in read{
        out exch write
    }{
        exit
    }ifelse
}loop
out closefile
in closefile

デコーダ

#!/bin/sh
exec gs -q -dNODISPLAY -dBATCH -D#!="{2{currentfile 128 string readline pop pop}repeat}" -- $0 "$@"

/in (%stdin)(r)file /ASCII85Decode filter def
/out (%stdout)(w)file  def
{
    in read{
        out exch write
    }{
        exit
    }ifelse
}loop
out closefile
in closefile