@qualithm/mqtt-wire - v0.1.5
    Preparing search index...

    Function encodeMqttString

    • Encodes a string with MQTT length prefix.

      MQTT strings are prefixed with a 2-byte big-endian length. Maximum string length is 65,535 bytes.

      Parameters

      • str: string

        The string to encode

      Returns Uint8Array

      The length-prefixed UTF-8 bytes

      RangeError if the encoded string exceeds 65,535 bytes

      MQTT 5.0 ยง1.5.4