Crypto & Security 1 credit COMPUTE

SHA256 Hash API

Compute cryptographic SHA256 hashes programmatically via a simple REST API. Send any string or binary data and receive the 64-character hex digest — the same output as openssl dgst -sha256 or Python's hashlib.sha256.

Try it live →

How it works

POST your input data as a JSON string. The API computes a SHA-256 digest using Node.js's built-in crypto module (no external dependencies) and returns the lowercase hex-encoded 32-byte hash. Processing is deterministic: the same input always produces the same output.

Use cases

API Reference

POST https://slopshop.gg/v1/crypto-hash-sha256
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
input / data string required The input data to hash or process

Example response

{
  "data": {
    "hash": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3",
    "algorithm": "sha256",
    "input_length": 11
  },
  "meta": {
    "credits_used": 1,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use SHA256 Hash in production.

Example 1
Hash a password
Generate a SHA256 digest of a user password for comparison (use crypto-password-hash for actual storage).
curl -X POST https://slopshop.gg/v1/crypto-hash-sha256 \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": "mysecretpassword"}'
Example 2
Generate cache key
Create a stable cache key from a composite identifier.
curl -X POST https://slopshop.gg/v1/crypto-hash-sha256 \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": "user:42:profile:settings"}'
Example 3
Verify file integrity
Hash a file's contents to check for tampering or corruption.
curl -X POST https://slopshop.gg/v1/crypto-hash-sha256 \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"data": "contents of important document..."}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/crypto-hash-sha256 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/crypto-hash-sha256",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/crypto-hash-sha256", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call crypto-hash-sha256
slop crypto-hash-sha256 '{"input": "your data here"}'

Pricing

Credits per call
1
credits
Cost per call
$0.001
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.

Related APIs in Crypto & Security

View the full API catalog · Try in playground · Documentation