Skip to content

Hash

What this does

Takes any text and returns its cryptographic hash: a fixed-length fingerprint of the input. Useful for checksums, cache keys, and comparing content without storing the original text. You choose the algorithm (SHA-256 is the default).

Who it is for

  • Developers generating cache keys
  • Audit trails (“hash of uploaded file contents”)
  • Testing that two strings match without revealing them
  • Learning how hashing works in a safe sandbox

Try it

SHA-256 of “hello”:

https://fetch.li/v1/hash?text=hello

Explicit algorithm:

https://fetch.li/v1/hash?text=hello&alg=sha256
https://fetch.li/v1/hash?text=hello&alg=sha512
https://fetch.li/v1/hash?text=hello&alg=md5

HTTP example

GET /v1/hash?text=hello&alg=sha256 HTTP/1.1
Host: fetch.li
Accept: application/json

curl

curl -sS "https://fetch.li/v1/hash?text=hello&alg=sha256"

JavaScript fetch

const response = await fetch(
  "https://fetch.li/v1/hash?text=hello&alg=sha256"
);
const hash = await response.json();
console.log(hash.digest);

Python requests

import requests

response = requests.get(
    "https://fetch.li/v1/hash",
    params={"text": "hello", "alg": "sha256"},
)
response.raise_for_status()
print(response.json()["digest"])

Example JSON response

{
  "alg": "sha256",
  "text_length": 5,
  "digest": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
  "encoding": "hex"
}

Parameters

Parameter Required Type Description
text Yes string Input string to hash (max 100,000 characters)
alg No string Algorithm: sha256 (default), sha512, or md5

Errors that can happen

HTTP error.code When
400 invalid_body Missing text, unsupported alg, or text too long
429 rate_limited Demo limit exceeded
500 internal Unexpected server error

Demo

GET endpoints work without an API key on the public demo tier (60 calls per hour per IP). POST /v1/vibe/classify needs a key.