leb128fmt

Function encode_u64

Source
pub const fn encode_u64(value: u64) -> Option<([u8; 10], usize)>
Expand description

Encodes a value as an unsigned LEB128 number.

If the value can be encoded in the given number of bits, then return the encoded output and the index after the last byte written.

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