# base64::decode_config - Rust
API documentation for the Rust `decode_config` fn in crate `base64`.
Keywords: rust, rustlang, rust-lang, decode_config

# [−] [src] Function base64::decode_config

    pub fn decode_config<T: AsRef<[u8]>>(
        input: T,
        config: Config
    ) -> Result<Vec<u8>, DecodeError>

Decode from string reference as octets. Returns a Result containing a Vec<u8>.

# Example

    extern crate base64;

    fn main() {
        let bytes = base64::decode_config("aGVsbG8gd29ybGR+Cg==", base64::STANDARD).unwrap();
        println!("{:?}", bytes);

        let bytes_url = base64::decode_config("aGVsbG8gaW50ZXJuZXR-Cg==", base64::URL_SAFE).unwrap();
        println!("{:?}", bytes_url);
    }