Expand description
Hex and Base64 codecs.
These exist so the CLI, MCP server, and ontology exports can move key material and test vectors around without pulling in a dependency. The decoders are constant-time with respect to the values they decode, which matters because agents routinely paste secrets through these paths.
Functionsยง
- b64
- Encode
inputas a padded standard Base64String. - base64_
decode - Decode padded standard Base64, returning the number of bytes written.
- base64_
encode - Encode
inputas padded standard Base64 intoout. - base64_
encoded_ len - Length of the standard-alphabet, padded Base64 encoding of
nbytes. - hex
- Encode
inputas a lowercase hexString. - hex_
decode - Decode a hex string into
out, accepting either case. - hex_
encode - Encode
inputas lowercase hex intoout. - unb64
- Decode a padded standard Base64 string into a freshly allocated
Vec. - unhex
- Decode a hex string into a freshly allocated
Vec.