Bit arrays represent a sequence of 1s and 0s, and are a convenient syntax for constructing and manipulating binary data.
Each segment of a bit array can be given options to specify the representation used for that segment.
size
: the size of the segment in bits.unit
: how many times to repeat the segment.bits
: a nested bit array of any size.bytes
: a nested byte-aligned bit array.float
: a 64 bits floating point number.int
: an int with a default size of 8 bits.big
: big endian.little
: little endian.native
: the endianness of the processor.utf8
: utf8 encoded text.utf16
: utf16 encoded text.utf32
: utf32 encoded text.Bit arrays have limited support when compiling to JavaScript, not all options can be used. Full bit array support will be implemented in future.