yEnc implementation in Python, bit slow

Freddie oinkfreddie at oinkshlick.oinknet
Tue Aug 5 00:37:55 EDT 2003


Freddie <oinkfreddie at oinkshlick.oinknet> wrote in
news:Xns93CE8D81747C5freddiethescaryeleph at 218.100.3.9: 

Arr. There's an error here, the [n+i+256+1] shouldn't have a 1. I always get 
that wrong :) The posted files actually decode now, and the yEncode() 
overhead is a lot lower.

<snip>

>      encoded = []
>      n = 0
>      for i in range(0, len(translated), 256):
>           chunk = translated[n+i:n+i+256]
>           if chunk[-1] == '=':
>                chunk += translated[n+i+256]       <<< this line
>                n += 1
>           encoded.append(chunk)
>           encoded.append('\n')

-- 
Remove the oinks!




More information about the Python-list mailing list