Skip to main content

Module core

Module core 

Source
Expand description

Small shared utilities: base64, sha256 (SHA-256, HMAC-SHA256) and the New trait (a constructor used across the crate, much like Default).

Modules§

base64
Base64 encoding and decoding of byte arrays. Decoder is the one decoder in the crate (standard, URL-safe or either alphabet; optional whitespace); Base64 keeps the original standard-alphabet API.
json
The JSON string escaper every module uses (18.24.0; before, several modules had their own, some of which left control characters raw).
sha256
SHA-256 (FIPS 180-4) and HMAC-SHA256 (RFC 2104), for code that must sign or verify without an optional crypto dependency — e.g. the MCP server’s requestState (MCP 2026-07-28). Not constant-time beyond verify’s comparison; not for secrets that a timing side channel would expose.
x509
X.509 certificate validity (notBefore/notAfter) and the RFC 9773 ARI certificate id, read with a minimal DER walker — shared by ACME renewal and the TLS certificate-expiry metric, so it isn’t behind a feature. Certificate bytes may come from a CA or a file: every length is checked, nothing panics on malformed input.

Traits§

New