lib:hex
Experimental
Hex encoding/decoding — bytes to hex string and back.
| Property | Value |
|---|---|
| Namespace | lib |
| Source | src/lua/lib/hex.rs |
| Tests | tests/lib/hex.test.luau |
| Stability | Experimental |
| Mirror | Rust hex crate; Python bytes.hex() / bytes.fromhex() |
Syntax
lua
local hex = require("lib:hex")Description
WARNING
Stub. Full surface in module source; contract exercised by test file.
encode is lowercase, encode_upper is uppercase. decode is case-insensitive and skips ASCII whitespace — "de ad be ef" decodes without pre-cleaning — then strict: odd-length or non-hex input returns (nil, err).
See also
- The module system
lib:base64— the sibling encoding modulelib:*