Function holochain::prelude::dependencies::kitsune_p2p_types::dependencies::lair_keystore_api::dependencies::base64::decode_config_buf
source · pub fn decode_config_buf<T>(
input: T,
config: Config,
buffer: &mut Vec<u8, Global>
) -> Result<(), DecodeError>where
T: AsRef<[u8]>,
Expand description
Decode from string reference as octets. Writes into the supplied buffer to avoid allocation. Returns a Result containing an empty tuple, aka ().
Example
extern crate base64;
fn main() {
let mut buffer = Vec::<u8>::new();
base64::decode_config_buf("aGVsbG8gd29ybGR+Cg==", base64::STANDARD, &mut buffer).unwrap();
println!("{:?}", buffer);
buffer.clear();
base64::decode_config_buf("aGVsbG8gaW50ZXJuZXR-Cg==", base64::URL_SAFE, &mut buffer)
.unwrap();
println!("{:?}", buffer);
}