pub fn encode(bytes: impl AsRef<[u8]>) -> String { hex::encode(bytes) } pub fn decode(s: &str) -> Result, &'static str> { hex::decode(s).map_err(|_| "invalid hex string") }