Содержание

9. Compressed text — ChatWire kind 0x09

Compressed text (ChatWireCompressedText)

Chat text encoded with an agreed vocabulary pack instead of raw UTF-8. Wire: S2P1 + 0x09 + langLen u8 + language UTF-8 (upper) + dictVersion u16 LE + payloadLen u32 LE + compressed payload bytes. Source: ChatWireCompressedText / EncodeCompressedText.

Compressed text

Example (unencrypted)

Logical: language = "RU", dictVersion = 1, payload = AA BB (demo)

Hex (unencrypted):
  53 32 50 31  09
  02  52 55           # langLen=2, "RU"
  01 00               # dictVersion = 1 LE
  02 00 00 00         # payloadLen = 2
  AA BB

Decoded: S2P1 | CompressedText | RU v1 | 2-byte payload