Skip to main content

Module hex

Module hex 

Source
Expand description

Tiny hex encoder used wherever a byte slice needs to be rendered as a hex string. Centralised so the same bytes.iter().map(|b| format!("{:02x}", b)).collect() doesn’t get re-typed across the crate.

Functions§

to_hex
Encode bytes as a lowercase hex string.
to_hex_prefix
Encode the first n bytes (or fewer) as lowercase hex. Useful for short identifiers like bearer:<sha256-prefix> labels.