bigIntToFixedBytes

fnubyte[] bigIntToFixedBytes(BigInt val, size_t len) @safe

Converts a non-negative BigInt to a fixed-width big-endian representation, zero-padded or truncated from the left.

Parameters

valThe value to convert.
lenThe desired output length in bytes.

Returns

Exactly len bytes, most significant first.