Hex bytes slice
hex-bytes-slice · version 1.0.0 · Encoding & checksums · free, no key needed
Slice a lowercase hex byte string by explicit byte-index bounds, half-open like Array.slice.
Use when you need to: hex bytes slice · slice hex byte string · byte-range slice of hex.
Decide before calling
Read the versioned contract and the supported scope below. Reuse hex-bytes-slice@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use hex-bytes-slice@1.0.0 for hex bytes slice. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- hex bytes slice
- slice hex byte string
- byte-range slice of hex
Not supported
- negative indexes
- python wrap-around slicing
- uppercase hex
- 0x prefix
- code-point or character slicing
- decode hex to text
Behavior
- hex is a lowercase hex byte string: 0-9 and a-f only, two hex digits per byte, no 0x prefix, no separators, no whitespace, no uppercase.
- hex is bounded to 128000 bytes (256000 hex characters).
- start and end are JSON integers with Number.isInteger, each between 0 and the byte-count bound, counting whole bytes (not hex characters).
- The slice is the half-open byte interval [start, end): the byte at index end is not included.
- end must be greater than or equal to start; start and end must each be at most the byte length of hex. Negative indexes, wrap-around, and end < start are rejected rather than reinterpreted.
- A slice where start equals end is allowed at any valid position and returns an empty result.
Input
hex(string, required): max length 256000start(integer, required): min 0; max 128000end(integer, required): min 0; max 128000
Output
hex(string, required)
Limits
- max input bytes: 128000
- max index: 128000
Example
Request input:
{
"hex": "aabbccdd",
"start": 1,
"end": 3
}
Response:
{
"result": {
"hex": "bbcc"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "hex-bytes-slice",
"version": "1.0.0",
"input": {
"hex": "aabbccdd",
"start": 1,
"end": 3
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/hex-bytes-slice/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"hex":"aabbccdd","start":1,"end":3}'
The machine-readable contract is at /v1/tools/hex-bytes-slice/versions/1.0.0.
CLI
node cli.mjs run hex-bytes-slice 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Hex bytes xor: Byte-wise XOR of two equal-length lowercase hex byte strings. Transformation only; no cryptographic security claim.
- Hex bytes concat: Concatenate a bounded ordered list of lowercase hex byte strings into one hex string.
- Bech32 validate: Check Bech32 or Bech32m text and return a reason, without throwing when the checksum fails.
- Iso8859 semantic decode: Decode ISO-8859-6 Arabic, ISO-8859-8 Hebrew, or ISO-8859-11 Thai bytes into logical Unicode text.
- Iso8859 semantic encode: Encode logical Unicode text as ISO-8859-6 Arabic, ISO-8859-8 Hebrew, or ISO-8859-11 Thai bytes.
- Pem envelope format: Format a label and lowercase hex bytes as a canonical RFC 7468 PEM envelope.