code: def create_chunk(buf):
      
      chunk = []
      chunk.append(s2b('{:X}\r\n'.format(len(buf))))
      chunk.append(buf)
      chunk.append(b'\r\n')
      return b''.join(chunk)
docs: Create a chunk for the HTTP "chunked" transfer encoding.