Generar hash
Generar hash es una API que calcula el hash (MD5, SHA-1, SHA-256 o SHA-512) de un texto o de un fichero: para comprobar integridad, deduplicar, o generar una clave corta a partir de un dato largo.
Cómo funciona
Le mandas un texto (dentro de un JSON) o un fichero (a pelo, en el propio cuerpo de la petición) y te devuelve su hash. Es la única herramienta de Cofferdock que admite estas dos entradas pero SIEMPRE responde en JSON: un hash es un dato pequeñísimo, no un archivo que necesites descargar.
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
Cómo usarlo en n8n (paso a paso)
En el nodo HTTP Request, para hashear un texto:
- Method:
POST - URL:
https://api.cofferdock.com/hash - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type=application/json - Send Body: actívalo → Body Content Type: JSON →
{ "text": "hola mundo", "algorithm": "sha256" }
Para hashear un fichero en vez de texto: Content-Type = application/octet-stream, y el cuerpo es el fichero en binario en vez de JSON (usa el parámetro algorithm en la URL, ej. ?algorithm=sha256, ya que en modo fichero no hay JSON donde meterlo).
En Make (módulo HTTP → Make a request): mismo método y URL, Body type: Raw, Content type: JSON, con el mismo cuerpo.
Opciones
| Opción | Por defecto | Para qué sirve |
|---|---|---|
text | - | El texto a hashear. Solo en modo JSON. |
algorithm | sha256 | md5, sha1, sha256 o sha512. |
encoding | hex | hex o base64. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/hash - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: JSON con
{ "text": "...", "algorithm"?, "encoding"? }, o un fichero a pelo (application/octet-stream) conalgorithm/encodingcomo Query Parameters. - Salida: SIEMPRE JSON, sin modo binario (a diferencia de otras tools de Cofferdock): el resultado es un dato mínimo, no un fichero.
- Motor:
crypto.createHash()nativo de Node.js, sin dependencias. - Texto: se hashea como UTF-8 explícito, para que el resultado sea reproducible con herramientas externas.
- Límites:
texthasta 1.000.000 caracteres; fichero binario hasta 25 MB (igual para todos los planes). 30 peticiones/min por IP. 1 llamada = 1 crédito.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
text | - | Obligatorio en modo JSON (ignorado en modo binario). No puede estar vacío. |
algorithm | sha256 | md5 | sha1 | sha256 | sha512 (400 si no está en la lista). |
encoding | hex | hex | base64. |
Ejemplos
curl (texto):
curl -X POST "https://api.cofferdock.com/hash" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/json" \
-d '{"text":"hola mundo","algorithm":"sha256"}'
curl (fichero):
curl -X POST "https://api.cofferdock.com/hash?algorithm=sha256" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/octet-stream" \
--data-binary "@documento.pdf"
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/hash', {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'hola mundo', algorithm: 'sha256' }),
});
const { hash } = await r.json();
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/hash',
headers={'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json'},
json={'text': 'hola mundo', 'algorithm': 'sha256'},
)
print(r.json())
Respuesta
{ "success": true, "hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
"algorithm": "sha256", "encoding": "hex",
"meta": { "input_mode": "text", "input_bytes": 5, "used": 12, "remaining": 488 } }
Lo que recibes
Un JSON con el hash en hash, más el algoritmo y la codificación usados. meta.input_mode te dice si se hasheó texto o un fichero.
Generate hash
Generate hash is an API that computes the hash (MD5, SHA-1, SHA-256 or SHA-512) of a piece of text or a file: for integrity checks, deduplication, or turning a long value into a short key.
How it works
You send some text (inside a JSON body) or a file (raw, in the request body itself) and get back its hash. It's the only Cofferdock tool that accepts both input types but ALWAYS responds in JSON: a hash is a tiny piece of data, not a file you'd need to download.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
How to use it in n8n (step by step)
In the HTTP Request node, to hash text:
- Method:
POST - URL:
https://api.cofferdock.com/hash - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/json - Send Body: on → Body Content Type: JSON →
{ "text": "hello world", "algorithm": "sha256" }
To hash a file instead of text: Content-Type = application/octet-stream, and the body is the raw file instead of JSON (use the algorithm parameter in the URL, e.g. ?algorithm=sha256, since file mode has no JSON to put it in).
In Make (HTTP → Make a request module): same method and URL, Body type: Raw, Content type: JSON, with the same body.
Options
| Option | Default | What it does |
|---|---|---|
text | - | The text to hash. JSON mode only. |
algorithm | sha256 | md5, sha1, sha256 or sha512. |
encoding | hex | hex or base64. |
API overview
- Endpoint:
POST https://api.cofferdock.com/hash - Auth: header
x-api-key: YOUR_KEY. - Input: JSON with
{ "text": "...", "algorithm"?, "encoding"? }, or a raw file (application/octet-stream) withalgorithm/encodingas Query Parameters. - Output: ALWAYS JSON, no binary mode (unlike other Cofferdock tools): the result is a tiny value, not a file.
- Engine: Node.js's native
crypto.createHash(), no dependencies. - Text: hashed as explicit UTF-8, so the result is reproducible with external tools.
- Limits:
textup to 1,000,000 characters; binary file up to 25 MB (same for every plan). 30 requests/min per IP. 1 call = 1 credit.
Options
| Option | Default | Description |
|---|---|---|
text | - | Required in JSON mode (ignored in binary mode). Can't be empty. |
algorithm | sha256 | md5 | sha1 | sha256 | sha512 (400 if not in the list). |
encoding | hex | hex | base64. |
Examples
curl (text):
curl -X POST "https://api.cofferdock.com/hash" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"hello world","algorithm":"sha256"}'
curl (file):
curl -X POST "https://api.cofferdock.com/hash?algorithm=sha256" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary "@document.pdf"
JavaScript (Node 18+):
const r = await fetch('https://api.cofferdock.com/hash', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'hello world', algorithm: 'sha256' }),
});
const { hash } = await r.json();
Python:
import requests
r = requests.post(
'https://api.cofferdock.com/hash',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json'},
json={'text': 'hello world', 'algorithm': 'sha256'},
)
print(r.json())
Response
{ "success": true, "hash": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
"algorithm": "sha256", "encoding": "hex",
"meta": { "input_mode": "text", "input_bytes": 5, "used": 12, "remaining": 488 } }
What you get back
A JSON with the hash in hash, plus the algorithm and encoding used. meta.input_mode tells you whether text or a file was hashed.