derEncodeLength

fnubyte[] derEncodeLength(size_t length) pure @safe

Encodes a length value using DER length encoding.

If the length is less than 128, a single byte is used. Otherwise, the first byte is 0x80 | N where N is the number of subsequent bytes that hold the length in big-endian order.

Parameters

lengthThe content length to encode.

Returns

The DER-encoded length bytes.