On 28Jan2020 23:09, Peng Yu <pengyu...@gmail.com> wrote:
I'd like to tell what part is zlib.compress data in an input stream.
One way is to use some characters that never appear in zlib.compress
output to denote the boundary. Are there such characters? Thanks.

If you mean: is there a byte which never appears, then apparently not:

 [~]fleet*1> python3 testzlib.py
 ........

where testzlib.py contains this code:

from random import randint
import sys
from zlib import compress

unseen = set(range(256))

while unseen:
 sys.stdout.write('.')
 sys.stdout.flush()
 block = bytes(randint(0,255) for _ in range(256))
 cdata = compress(block)
 for c in cdata:
   unseen.discard(c)

sys.stdout.write('\n')
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to