Function base64::encode_config_buf

source ·
pub fn encode_config_buf<T: AsRef<[u8]>>(
    input: T,
    config: Config,
    buf: &mut String
)
Expand description

Encode arbitrary octets as base64. Writes into the supplied output buffer, which will grow the buffer if needed.

Example

extern crate base64;

fn main() {
    let mut buf = String::new();
    base64::encode_config_buf(b"hello world~", base64::STANDARD, &mut buf);
    println!("{}", buf);

    buf.clear();
    base64::encode_config_buf(b"hello internet~", base64::URL_SAFE, &mut buf);
    println!("{}", buf);
}