Interface DecoderBitMaskings

Specifies bit maskings to use when reading unsigned ints.

interface DecoderBitMaskings {
    bits: number[];
}

Hierarchy

  • BitMaskings
    • DecoderBitMaskings

Properties

Properties

bits: number[]

List of bit masks to use. Masks must add up to the total bit size of the associated data type, such as:

// ok
uint32({ bits: [1, 31] }); // 1 + 31 == 32
uint64({ bits: [2, 2, 60] }); // 2 + 2 + 60 == 64

// exception!
uint32({ bits: [1, 9] }); // 1 + 9 != 32
uint64({ bits: [2, 2, 64] }); // 2 + 2 + 64 != 64