> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bunny.build/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /hash

> Calcule digests criptográficos (MD5, SHA-1, SHA-256, SHA-512 e mais) a partir de qualquer string.

## Endpoint

```
POST https://api.bunny.build/api/v1/hash
```

## Autenticação

| Header         | Obrigatório | Valor                        |
| -------------- | ----------- | ---------------------------- |
| `X-API-Key`    | Sim         | Sua chave de API (`bun_...`) |
| `Content-Type` | Sim         | `application/json`           |

## Visão geral

Calcule digests criptográficos para qualquer string de entrada usando um ou mais algoritmos em uma única requisição. A resposta retorna digests em hexadecimal indexados pelo nome do algoritmo, facilitando a comparação ou armazenamento de múltiplos hashes simultaneamente sem requisições separadas.

## Casos de uso

* Verificar integridade de arquivos ou payloads por comparação de checksums
* Migrar hashes de senhas legados durante atualizações de sistemas de autenticação
* Gerar impressões digitais consistentes para pipelines de deduplicação
* Produzir identificadores endereçáveis por conteúdo para camadas de cache

## Corpo da requisição

| Campo        | Tipo             | Obrigatório | Descrição                                                                                               |
| ------------ | ---------------- | ----------- | ------------------------------------------------------------------------------------------------------- |
| `input`      | string           | Sim         | A string a ser hasheada                                                                                 |
| `algorithms` | array de strings | Não         | Algoritmos a calcular. Padrão: todos. Opções: `md5`, `sha1`, `sha256`, `sha384`, `sha512`, `sha512-256` |

### Exemplo

```json theme={null}
{
  "input": "hello world",
  "algorithms": ["sha256", "md5"]
}
```

## Resposta

### 200 OK

| Campo    | Tipo   | Descrição                                              |
| -------- | ------ | ------------------------------------------------------ |
| `input`  | string | A string de entrada original                           |
| `hashes` | object | Mapa do nome do algoritmo para o digest em hexadecimal |

**Exemplo**

```json theme={null}
{
  "input": "hello world",
  "hashes": {
    "sha256": "b94d27b9934d3e08a52e52d7da7dabfac484efe04294e576f01c87a7cbc1ab15",
    "md5": "5eb63bbbe01eeed093cb22bb8f5acdc3"
  }
}
```

### 401 Unauthorized

```json theme={null}
{
  "detail": "Missing API key. Include X-API-Key header."
}
```

### 402 Payment Required

```json theme={null}
{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}
```

### 422 Unprocessable Entity

```json theme={null}
{
  "detail": "Field 'input' is required."
}
```

### 429 Too Many Requests

```json theme={null}
{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}
```

## Exemplo cURL

```bash theme={null}
curl -X POST https://api.bunny.build/api/v1/hash \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"input": "hello world", "algorithms": ["sha256", "md5"]}'
```
