1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465(* nil format *)letnil='\xc0'(* bool format family *)letfalse_='\xc2'lettrue_='\xc3'(* The ``fix'' variants of each family encode some information about the item (typically the
size) in the header byte itself. For example, a header byte of [1110 1111] matches the mask
[111X XXXX], which means ``negative fixint'', and represents a value of -15, as the remaining
bits are [0 1111] = 15.
See [https://github.com/msgpack/msgpack/blob/master/spec.md#formats] for the technical
details.
*)(* int format family *)(* The format for positive fixints is [0XXX YYYY], so the correct way to test a byte against
this mask is to check that [ value & unmask == value ].
*)letpositive_fixint_unmask=0x7Fletnegative_fixint_mask=0xE0letuint8_header='\xcc'letuint16_header='\xcd'letuint32_header='\xce'letuint64_header='\xcf'letint8_header='\xd0'letint16_header='\xd1'letint32_header='\xd2'letint64_header='\xd3'(* float format family *)letfloat32_header='\xca'letfloat64_header='\xcb'(* string format family *)letfixstr_mask=0xA0letstr8_header='\xd9'letstr16_header='\xda'letstr32_header='\xdb'(* binary format family *)letbin8_header='\xc4'letbin16_header='\xc5'letbin32_header='\xc6'(* array format family *)letfixarray_mask=0x90letarray16_header='\xdc'letarray32_header='\xdd'(* map format family *)letfixmap_mask=0x80letmap16_header='\xde'letmap32_header='\xdf'(* ext format family *)letfixext1_header='\xd4'letfixext2_header='\xd5'letfixext4_header='\xd6'letfixext8_header='\xd7'letfixext16_header='\xd8'letext8_header='\xc7'letext16_header='\xc8'letext32_header='\xc9'