code: def generate_message_lengths_array(outf, msgs):
      
  
      # form message lengths array
      lengths = []
      for msg in msgs:
          lengths.append("%u: %u" % (msg.id, msg.wire_length))
  
      t.write(outf, """
  
  
  /**
      Message lengths array for known messages length validation
  */
  private let messageLengths: [UInt8: UInt8] = [${ARRAY_CONTENT}]
  """, {'ARRAY_CONTENT' : ", ".join(lengths)})
docs: Create array with message lengths to validate known message lengths