base64

Function encode_config

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

Encode arbitrary octets as base64. Returns a String.

ยงExample

extern crate base64;

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

    let b64_url = base64::encode_config(b"hello internet~", base64::URL_SAFE);
    println!("{}", b64_url);
}