Skip to main content

Module encoding

Module encoding 

Source
Expand description

Encoding helpers (base64, hex, URL) backed by the host runtime.

These are zero-dep wrappers - calling the host avoids pulling a Rust base64/hex crate into your Wasm binary, which keeps .wasm size down.

Functionsยง

base64_decode
Decode a base64 string into raw bytes.
base64_encode
Base64-encode a byte slice using the standard alphabet (with padding).
hex_decode
Decode a hex string into raw bytes. Accepts upper or lower case.
hex_encode
Hex-encode a byte slice (lowercase, no separators).
url_decode
URL-decode a percent-encoded string.
url_encode
URL-encode a string using percent-encoding (application/x-www-form-urlencoded rules).