base64

Function encode

Source
pub fn encode<T: ?Sized + AsRef<[u8]>>(input: &T) -> String
Expand description

Encode arbitrary octets as base64. Returns a String. Convenience for encode_config(input, base64::STANDARD);.

ยงExample

extern crate base64;

fn main() {
    let b64 = base64::encode(b"hello world");
    println!("{}", b64);
}