use base64::Engine;
use crate::b64::b64_common::DecodeError;

pub(crate) fn base64_encode(b: &[u8]) -> String {
    base64::engine::general_purpose::STANDARD.encode(b)
}

pub(crate) fn base64_decode(b: &str) -> Result<Vec<u8>, DecodeError> {
    Ok(base64::engine::general_purpose::STANDARD.decode(b)?)
}