Function base64::decode_engine_slice[][src]

pub fn decode_engine_slice<'e, 'o, E: Engine, T: AsRef<[u8]>>(
    input: T,
    output: &'o mut [u8],
    engine: &'e E
) -> Result<usize, DecodeError>
Expand description

Decode the input into the provided output slice.

This will not write any bytes past exactly what is decoded (no stray garbage bytes at the end).

If you don’t know ahead of time what the decoded length should be, size your buffer with a conservative estimate for the decoded length of an input: 3 bytes of output for every 4 bytes of input, rounded up, or in other words (input_len + 3) / 4 * 3.

Panics

If the slice is not large enough, this will panic.