Function chewdata::updater::tera_helpers::function::string::base64_decode

source ·
pub fn base64_decode(args: &HashMap<String, Value>) -> Result<Value>
Expand description

Returns a decoded base64 string.

§Arguments

  • value - A base64 string slice to decode.
  • config - Possible configuration: standard_no_pad | url_safe | url_safe_no_pad | standard

§Examples

use std::collections::HashMap;
use serde_json::value::Value;
use chewdata::updater::tera_helpers::function::string::base64_decode;

let mut args = HashMap::new();
args.insert("value".to_string(), Value::String("bXlfdGVzdA==".to_string()));
let value = base64_decode(&args).unwrap();
assert_eq!("my_test", value.as_str().unwrap());