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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| 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