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.