xtract.bot
POST /api/hash-text

Compute SHA-1, SHA-256, SHA-384, or SHA-512 hash of a text string. Returns the digest in hex. Standard cryptographic primitives, no salt.

Returns the cryptographic hash of a text string in hex. Algorithms: `sha-1`, `sha-256` (default), `sha-384`, `sha-512`. The text is encoded as UTF-8 before hashing. For arbitrary binary inputs use `hash-file` instead. Note: hashing is *not* secure password storage. For passwords use a slow KDF like Argon2 or bcrypt, not raw SHA.

Inputs

NameTypeDefaultDescription
data*fileBytes to hash.
algorithmenum (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"'"
}'