packUint32

fnResult!(size_t, BitpackError) packUint32(scope const(uint)[] values, ubyte width, return scope ubyte[] dst) @safe pure nothrow @nogc

Packs unsigned 32-bit values at width bits each (LSB-first).

Parameters

valuesthe values to pack (each must be < 2^width).
widthbits per value, 1..32.
dstcaller-provided output buffer (≥ packedSize bytes).

Returns

Result!(size_t, BitpackError): bytes written. Failures leave

dst untouched: INVALID_WIDTH, INSUFFICIENT_CAPACITY (context == 0), INVALID_VALUE (context = value index).