def consume_length_prefix(rlp, start):
b0 = rlp[start]<EOL>if b0 < <NUM_LIT>:  <EOL><INDENT>return (b'<STR_LIT>', bytes, <NUM_LIT:1>, start)<EOL><DEDENT>elif b0 < SHORT_STRING:  <EOL><INDENT>if b0 - <NUM_LIT> == <NUM_LIT:1> and rlp[start + <NUM_LIT:1>] < <NUM_LIT>:<EOL><INDENT>raise DecodingError('<STR_LIT>', rlp)<EOL><DEDENT>return (rlp[start:start + <NUM_LIT:1>], bytes, b0 - <NUM_LIT>, start + <NUM_LIT:1>)<EOL><DEDENT>elif b0 < <NUM_LIT>:  <EOL><INDENT>ll = b0 - <NUM_LIT>  <EOL>if rlp[start + <NUM_LIT:1>:start + <NUM_LIT:2>] == b'<STR_LIT:\x00>':<EOL><INDENT>raise DecodingError('<STR_LIT>', rlp)<EOL><DEDENT>len_prefix = rlp[start + <NUM_LIT:1>:start + <NUM_LIT:1> + ll]<EOL>l = big_endian_to_int(len_prefix)  <EOL>if l < <NUM_LIT>:<EOL><INDENT>raise DecodingError('<STR_LIT>', rlp)<EOL><DEDENT>return (rlp[start:start + <NUM_LIT:1>] + len_prefix, bytes, l, start + <NUM_LIT:1> + ll)<EOL><DEDENT>elif b0 < <NUM_LIT> + <NUM_LIT>:  <EOL><INDENT>return (rlp[start:start + <NUM_LIT:1>], list, b0 - <NUM_LIT>, start + <NUM_LIT:1>)<EOL><DEDENT>else:  <EOL><INDENT>ll = b0 - <NUM_LIT> - <NUM_LIT> + <NUM_LIT:1><EOL>if rlp[start + <NUM_LIT:1>:start + <NUM_LIT:2>] == b'<STR_LIT:\x00>':<EOL><INDENT>raise DecodingError('<STR_LIT>', rlp)<EOL><DEDENT>len_prefix = rlp[start + <NUM_LIT:1>:start + <NUM_LIT:1> + ll]<EOL>l = big_endian_to_int(len_prefix)  <EOL>if l < <NUM_LIT>:<EOL><INDENT>raise DecodingError('<STR_LIT>', rlp)<EOL><DEDENT>return (rlp[start:start + <NUM_LIT:1>] + len_prefix, list, l, start + <NUM_LIT:1> + ll)<EOL><DEDENT>
Read a length prefix from an RLP string.

    :param rlp: the rlp byte string to read from
    :param start: the position at which to start reading
    :returns: a tuple ``(prefix, type, length, end)``, where ``type`` is either ``str``
              or ``list`` depending on the type of the following payload,
              ``length`` is the length of the payload in bytes, and ``end`` is
              the position of the first payload byte in the rlp string