# Hash Text (`crypto.hash`)

Compute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 digests of a UTF-8 text in hex or Base64. Do not send secrets: inputs are stored with your request history.

- **Route:** `POST /v1/run/crypto.hash`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 0 ms · p95 0 ms · p99 0 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `text` | string | yes |  | Text to hash |
| `algorithm` | string | no | "all" | Digest to return, or all |
| `encoding` | string | no | "hex" | Digest encoding |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `digests` | Digest per algorithm. |
| `bytes` | Size of the input in bytes. |
| `encoding` | hex or base64. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/crypto.hash \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"hello world","algorithm":"sha256"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('crypto.hash', {'text': 'hello world', 'algorithm': 'sha256'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run crypto.hash '{"text":"hello world","algorithm":"sha256"}'
```

Quote first (free, validates input): `POST /v1/quote/crypto.hash` with the same body.
