Hex encode
Try it interactively →POST /api/hex-encodeEncode bytes as hex (lowercase, uppercase, with optional `0x` prefix or `:` separators). The classic format for inspecting bytes.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| data* | file | — | Bytes to encode (base64-encoded by the playground). |
| case | enum (lower | upper) | "lower" | Case of the hex digits a-f. |
| separator | string | "" | Optional separator inserted between every byte. |
| prefix | boolean | false | Prepend '0x' to the result. |
Response
Modes: json, text. Cache: yes (24h TTL).
Code samples
Built from the hello-lower example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/hex-encode/hello.txt
DATA=$(base64 -w0 < hello.txt)
curl -X POST https://api.xtract.bot/api/hex-encode \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"case": "lower",
"separator": "",
"prefix": false,
"data": "'"$DATA"'"
}'