in datasketches/PySerDe.py [0:0]
def from_bytes(self, data: bytes, offset: int):
num_chars = int.from_bytes(data[offset:offset+3], 'little')
if (num_chars < 0 or num_chars > offset + len(data)):
raise IndexError(f'num_chars read must be non-negative and not larger than the buffer. Found {num_chars}')
str = data[offset+4:offset+4+num_chars].decode()
return (str, 4+num_chars)