Skip to content

lib:hex

Experimental

Hex encoding/decoding — bytes to hex string and back.

PropertyValue
Namespacelib
Sourcesrc/lua/lib/hex.rs
Teststests/lib/hex.test.luau
StabilityExperimental
MirrorRust 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