xtract.bot
POST /api/hash-file

Compute SHA-1, SHA-256, SHA-384, or SHA-512 hash of a file. Returns the digest in hex. The standard primitive for content fingerprinting and integrity checks.

Returns the cryptographic hash of arbitrary file bytes in hex. Use this for content fingerprints, dedup keys, integrity checks against a known-good digest, etc. Algorithms: `sha-1`, `sha-256` (default), `sha-384`, `sha-512`. Hashing is one-way: there is no inverse. Two different inputs will (with overwhelming probability) produce different digests.

Inputs

NameTypeDefaultDescription
data*fileBytes to hash.
algorithmenum (SHA-1 | SHA-256 | SHA-384 | SHA-512)"SHA-256"Hash algorithm.

Response

Modes: json. Cache: yes (24h TTL).

Code samples

Built from the abc example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/hash-file/abc.txt
DATA=$(base64 -w0 < abc.txt)

curl -X POST https://api.xtract.bot/api/hash-file \
  -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"'"
}'