Rust base64::decode

Decodes a base64 string

Function

pub fn decode(input: &str) -> Result<Vec<u8>, Base64Error>

Parameters

input - encoded string

Return value

Returns a Result containing a Vec

Example

extern crate base64;
use std::str;

fn main() {
  let bytes = base64::decode("YmFzZTY0IGRlY29kZQ==").unwrap();
  let str = str::from_utf8(&bytes).unwrap();
  println!("{}", str);
}

Github