Skip to content

std/hex

std/hex — lowercase hex encode / decode. hex_encode(s) / hex_decode(s) — round-trip content-preserving on raw bytes. Encode emits lowercase 0-9a-f. Decode accepts both cases; terminates at the first non-hex character or at an odd-length tail without raising — partial inputs round-trip cleanly. Companion to base64 with no = padding. Migrated from the auto-injected prelude per docs/PRELUDE-TO-MODULES.md.

pub function hex_encode(s: string): string
pub function hex_decode(s: string): string