leb128fmt

Function encode_fixed_u32

Source
pub const fn encode_fixed_u32(value: u32) -> Option<[u8; 5]>
Expand description

Encodes an unsigned LEB128 number with using the maximum number of bytes for the given bits length.

If the value can be encoded in the given number of bits, then return the encoded value.

If the value cannot be encoded with the given number of bits, then return None.