Skip to main content

Module hex

Module hex 

Source
Expand description

Hex codec for the guest/host wire boundary.

Every loader that hands raw bytes across an untrusted boundary (Extism’s JSON host-fn wire, Rhai’s script boundary) needs the same lowercase-hex encode/decode pair. They were implemented independently and byte-identically in uni-plugin-extism and uni-plugin-rhai; they live here so the panic-safety property below is stated and tested once.

Functions§

from_hex
Decode lowercase/uppercase hex; errors on odd length or non-hex digits.
to_hex
Lowercase hex encoding for the guest/host wire boundary.