Function pw_base64::encode_str
source · pub fn encode_str<'a>(
input: &[u8],
output_buffer: &'a mut [u8]
) -> Result<&'a str>
Expand description
Encode input
as base64 into output_buffer
and interprets it as a
string.
Returns a &str
referencing the output_buffer
buffer on success or
Error::OutOfRange
if output_buffer
is not large enough.
Using this method avoids having to do unicode checking as it can guarantee
that the data written to output_buffer
is only valid ASCII bytes.