Skip to main content

encode

Function encode 

Source
pub fn encode(data: impl AsRef<[u8]>) -> String
Available on crate features alloc only.
Expand description

Encodes bytes to a lowercase hex string.

This is a convenience wrapper around encode_with_alphabet using Alphabet::Lower.

ยงExample

assert_eq!(hex::encode(b"hello"), "68656c6c6f");