Function lexical_write_integer::algorithm::algorithm

source ·
pub fn algorithm<T>(
    value: T,
    radix: u32,
    table: &[u8],
    buffer: &mut [u8],
    count: usize,
) -> usize
where T: UnsignedInteger,
Expand description

Optimized implementation for radix-N numbers.

§Safety

Safe as long as the buffer is large enough to hold as many digits that can be in the largest value of T, in radix N. For decimal values, it’s supposed to be exactly digit_count to avoid copies, since we write from the end to the front.

See the crate crate documentation for more security considerations.