encode_to_string_with_prefix

Function encode_to_string_with_prefix 

Source
pub fn encode_to_string_with_prefix(
    input: &[u8],
    prefix: &str,
) -> Result<String, EncodeError>
Expand description

Encode input as base64 into a new String with the supplied prefix.

ยงExample

use weakauras_codec_base64::{encode::encode_to_string_with_prefix, error::EncodeError};

fn main() -> Result<(), EncodeError> {
    assert_eq!(
        encode_to_string_with_prefix(b"Hello, world!", "!WA:2!")?,
        "!WA:2!ivgBS9glGC3BYXgzHa"
    );
    Ok(())
}