encode

Function encode 

Source
pub fn encode(input: &[u8]) -> String
Available on crate feature alloc only.
Expand description

Constant-Time Hex Encoding

§Arguments

  • input - A slice of bytes to be hex-encoded.

§Returns

The hex-encoded String

§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));