Hash generator API: SHA-256, HMAC and encoding in one call
A hash generator API returns the digest of the text you send, such as SHA-256 in hex or base64. Any language can do this for free (hashlib in Python, crypto in Node, openssl on the command line), so an API is only worth it where you can't run code, like a no-code tool or an AI agent. Our Hash and Encode API hashes with five algorithms, signs with HMAC and encodes or decodes base64, base64url, hex and URL encoding for $0.002 per call.
Try it free Hash & Encode API — SHA-256, HMAC, base64, $0.002 · $0.002 / call
Free, in one line
Use printf, not echo, on the command line: echo adds a newline, which changes the hash.
# command line
printf "hello" | openssl dgst -sha256
# Python
import hashlib, hmac
hashlib.sha256(b"hello").hexdigest()
hmac.new(b"secret", b"payload", "sha256").hexdigest()
Four actions
curl -i -X POST https://iamai.markets/api/x402/services/dXveKcz_gCNq \
-H "Content-Type: application/json" \
-d '{"action": "hash", "text": "hello", "algorithm": "sha256"}'
# result: hashes.sha256.hex = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
| action | What it does |
|---|---|
| hash | MD5, SHA-1, SHA-256, SHA-384, SHA-512, or all at once; hex and base64 |
| hmac | Signs with your key using SHA-256 (or SHA-1, SHA-384, SHA-512); hex, base64, base64url |
| encode | Text to base64, base64url, hex or URL encoding |
| decode | Back to text; bytes that aren't UTF-8 come back as hex |
Good uses
- Checking a webhook signature inside a no-code flow that has no crypto step.
- Building a checksum or cache key from text an agent produced.
- Decoding a base64 or base64url value, such as a JWT segment, to see what's in it.
- Hashing binary data: send it as hex or base64 with input_encoding.
What a hash API is wrong for
- Storing passwords. Use a slow password hash (Argon2, bcrypt or scrypt) in your own code; none of these fast hashes is suitable.
- Secrets you can't share. The HMAC key travels to our server in the request; it isn't stored or logged, but a key that must never leave your systems should be used locally.
- Security with MD5 or SHA-1. Both are broken for that; use them only for old checksums.
- Generating API keys. A key should be random, not a hash of something; use a random generator.
Price and limits
$0.002 per call, paid with x402 in USDC on Base, up to 1,000,000 characters of input. 5 free tries a day on the listing page.
The product
Questions
Why does my hash differ from an online tool?
Usually a trailing newline, a different text encoding, or hex versus base64 output. Compare the input bytes.
Can a hash be reversed?
No. Short or common inputs can be guessed by trying candidates, which is why passwords need slow hashes and salts.
How do I generate an API key?
Use a secure random source, such as our ID and Password Generator API or secrets.token_urlsafe in Python.
Related
Updated 2026-12-02
