use faster_hex::Error;
#[inline]
pub fn encode(src: impl AsRef<[u8]>) -> String {
faster_hex::hex_string(src.as_ref())
}
#[inline]
pub fn decode(src: impl AsRef<[u8]>) -> Result<Vec<u8>, Error> {
fn inner(bytes: &[u8]) -> Result<Vec<u8>, Error> {
let mut dst = vec![0; bytes.len() / 2];
faster_hex::hex_decode(bytes, &mut dst)?;
Ok(dst)
}
inner(src.as_ref())
}