📦 Archived documentation: r1 (committed 2026-07-24) View current documentation →

bin.fromHex()

bin.fromHex(hex) → binary

Converts a hex string into a binary object.

The inverse of bin.toHex(). Handy for pasting captured payloads back into a script, or for decoding hex-encoded configuration values.

Arguments

NameTypeRequiredDefaultDescription
hex string yes Hex text, e.g. "01fe".

Returns

binary The decoded binary data.

Example

let bytes = bin.fromHex("01fe");
print(bin.toHex(bytes)); // 01fe