Skip to main content

Module codec

Module codec 

Source
Expand description

Small, strict hex and base64 codecs (the kernel carries no hex/base64 crates, and these inputs are all short, bounded key material).

Functionsยง

base64_decode
Decode base64 in either the standard or the URL-safe alphabet, with or without = padding. Whitespace is refused. Non-canonical trailing bits are refused so an encoding cannot be malleated.
hex_decode_exact
Decode lower-case hex of exactly N bytes. Upper-case is refused so each value has one spelling.
hex_encode
Lower-case hex encoding.
is_lower_hex
True when s is exactly len lower-case hex characters.