Files
skills/docs/foundation/bitpacker/bitpacker-strategies/src/strategies/array-config/array-config.md
2026-05-29 08:20:56 +01:00

804 B

ArrayConfigPackingStrategy

Packs/unpacks arrays described by an explicit configuration object.

(no submodules)

Schema shape

{
  type: "array",
  maxLength: number,
  elementType: "integer" | "float" | "string" | "boolean" | "schema",
  elementMax?: number,        // for integer / float / string
  elementSchema?: BitPackerSchema // for elementType "schema"
}

Behaviour

  • Writes the array length using the minimum bits required for maxLength.
  • Each element is packed according to its elementType.
  • float elements are encoded as unsigned integers up to elementMax.
  • string elements are encoded as fixed-length byte sequences (padded with null bytes).
  • schema elements are recursively packed via the strategy chain.