Expand description
CLASP Binary Codec
Efficient binary encoding for all CLASP messages. Backward compatible: can decode v2 MessagePack frames.
§Performance
Compared to v2 (MessagePack with named keys):
- SET message: 69 bytes → 32 bytes (54% smaller)
- Encoding speed: ~10M msg/s (vs 1.8M)
- Decoding speed: ~12M msg/s (vs 1.5M)
Modules§
- msg
- Message type codes
- phase
- Gesture phase codes
- sig
- Signal type codes
- val
- Value type codes for efficient binary encoding
Constants§
- ENCODING_
VERSION - Encoding version (1 = binary encoding, 0 = MessagePack legacy)
Functions§
- decode
- Decode a frame and extract the message
- decode_
message - Decode a message - auto-detects MessagePack (legacy) vs binary encoding
- decode_
payload - Helper to decode just a message payload (without frame)
- encode
- Encode a message into a complete frame (binary encoding)
- encode_
message - Encode a message to binary format
- encode_
payload - Helper to encode just the message payload (without frame) - binary encoding
- encode_
with_ options - Encode a message with options (binary encoding)