Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Type Codes

Complete reference of Relish type codes.

For the authoritative specification, see the Relish Spec.

Primitive Types

TypeCodeJavaScriptNotes
Null0x00nullNo payload
Bool0x01boolean0x00 = false, 0xFF = true
u80x02number1 byte unsigned
u160x03number2 bytes little-endian
u320x04number4 bytes little-endian
u640x05bigint8 bytes little-endian
u1280x06bigint16 bytes little-endian
i80x07number1 byte signed
i160x08number2 bytes little-endian
i320x09number4 bytes little-endian
i640x0abigint8 bytes little-endian
i1280x0bbigint16 bytes little-endian
f320x0cnumberIEEE 754 single
f640x0dnumberIEEE 754 double
Timestamp0x13bigint / DateTimeUnix seconds (8 bytes)

Variable-Length Types

TypeCodeJavaScriptNotes
String0x0estringUTF-8 encoded
Array0x0fArray<T>Length-prefixed elements
Map0x10Map<K, V>Length-prefixed key-value pairs

Composite Types

TypeCodeJavaScriptNotes
Struct0x11objectField ID + value pairs
Enum0x12tagged unionVariant ID + value

Reserved

Bit 7 (0x80) is reserved for future use.

Next Steps

See Wire Format for encoding details.