Skip to main content

to_base64

Function to_base64 

Source
pub fn to_base64(dst: &mut [u8], src: &[u8]) -> Result<usize, Error>
Expand description

to_base64(dst, dst_len, src, src_len).

Writes the unpadded base64 of src into dst and returns how many bytes were written. No NUL terminator is written (the C writes one; Rust does not need it), but the capacity check is kept identical: the C requires dst_len > olen, so this requires dst.len() > b64_len(src.len()).

ยงErrors

Error::EncodingFail if dst is too small.