pub trait ToHex {
// Required methods
fn to_hex(&self) -> String;
fn to_hex_upper(&self) -> String;
fn to_hex_zeroizing(&self) -> EncodedSecret;
fn to_hex_upper_zeroizing(&self) -> EncodedSecret;
}Expand description
Extension trait for encoding byte data as hexadecimal strings.
Requires feature encoding-hex.
Blanket-implemented for all AsRef<[u8]> types (byte slices, arrays, Vec<u8>).
To encode a secret wrapper, call the inherent to_hex() method directly (ergonomically
safest for single operations — no reference in the caller’s hands), or use
with_secret(|b| b.to_hex()) for multi-step operations or when audit-greppability matters.
Required Methods§
Sourcefn to_hex_upper(&self) -> String
fn to_hex_upper(&self) -> String
Encode bytes as uppercase hexadecimal.
Sourcefn to_hex_zeroizing(&self) -> EncodedSecret
fn to_hex_zeroizing(&self) -> EncodedSecret
Encode bytes as lowercase hexadecimal and wrap the result in crate::EncodedSecret.
Sourcefn to_hex_upper_zeroizing(&self) -> EncodedSecret
fn to_hex_upper_zeroizing(&self) -> EncodedSecret
Encode bytes as uppercase hexadecimal and wrap the result in crate::EncodedSecret.