Hash bytes
Try it interactively →POST /api/hash-textCompute SHA-1, SHA-256, SHA-384, or SHA-512 hash of a text string. Returns the digest in hex. Standard cryptographic primitives, no salt.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| data* | file | — | Bytes to hash. |
| algorithm | enum (sha-1 | sha-256 | sha-384 | sha-512) | "sha-256" | Hash algorithm. |
Response
Modes: json, text. Cache: yes (24h TTL).
Code samples
Built from the hello example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/hash-text/hello.txt
DATA=$(base64 -w0 < hello.txt)
curl -X POST https://api.xtract.bot/api/hash-text \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"algorithm": "sha-256",
"data": "'"$DATA"'"
}'