calculating len/crc straight from the buffer