decode

Function decode 

Source
pub fn decode(input: &[u8]) -> Result<Vec<u8>, HexError>
Available on crate feature alloc only.
Expand description

Constant-Time Hex Decoding

§Arguments

  • input - The hex-encoded slice to decode.

§Errors

§Returns

The decoded bytes.

§Example

use wolf_crypto::{hex, ct_eq};

let encoded = hex::encode(b"hello world");
let decoded = hex::decode(encoded.as_bytes()).unwrap();

assert!(ct_eq(b"hello world", decoded));