RESTful API Service for SHA-224 Hash Generation
The SHA-224 Hash API provides a simple, secure, and scalable way to generate SHA-224 hashes for your applications. Perfect for data integrity verification, digital signatures, and secure storage.
https://api.sha224.com/v2
X-API-Key: your_api_key_here
https://api.sha224.com/v2/hash?api_key=your_api_key_here
Authorization: Bearer your_api_key_here
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | Required | The text or data to hash |
| encoding | string | Optional | Input encoding: utf8 (default), base64, hex |
| output | string | Optional | Output format: hex (default), base64, binary |
curl -X POST https://api.sha224.com/v2/hash \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"data": "Hello, World!",
"encoding": "utf8",
"output": "hex"
}'
{
"success": true,
"hash": "4149da18aa8bfc2b1e382c6c26556d01a92c261b6436dad5e3be3fcc",
"algorithm": "SHA-224",
"encoding": "hex",
"timestamp": "2024-01-15T10:30:45.123Z",
"processing_time_ms": 2
}
{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Data parameter is required",
"details": "Request body must contain 'data' field"
}
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| items | array | Required | Array of items to hash (max 1000) |
| parallel | boolean | Optional | Process in parallel (default: true) |
curl -X POST https://api.sha224.com/v2/batch \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"id": "1", "data": "First text"},
{"id": "2", "data": "Second text"},
{"id": "3", "data": "Third text"}
],
"parallel": true
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Required | File to hash (max 100MB) |
| chunk_size | integer | Optional | Chunk size for processing (default: 1MB) |
curl -X POST https://api.sha224.com/v2/file \
-H "X-API-Key: your_api_key" \
-F "file=@/path/to/document.pdf"
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | Required | Data to authenticate |
| key | string | Required | Secret key for HMAC |
| key_encoding | string | Optional | Key encoding: utf8 (default), hex, base64 |
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | string | Required | Original data |
| hash | string | Required | Hash to verify |
{
"success": true,
"valid": true,
"message": "Hash verification successful",
"expected_hash": "4149da18aa8bfc2b1e382c6c26556d01a92c261b6436dad5e3be3fcc",
"provided_hash": "4149da18aa8bfc2b1e382c6c26556d01a92c261b6436dad5e3be3fcc"
}
For files larger than 100MB, use the streaming endpoint with chunked transfer encoding.
const fs = require('fs');
const https = require('https');
const fileStream = fs.createReadStream('large-file.bin');
const req = https.request({
hostname: 'api.sha224.com',
path: '/v2/stream',
method: 'POST',
headers: {
'X-API-Key': 'your_api_key',
'Transfer-Encoding': 'chunked',
'Content-Type': 'application/octet-stream'
}
});
fileStream.pipe(req);
req.on('response', (res) => {
// Handle response
});
Real-time SHA-224 hashing via WebSocket connection for high-volume or streaming applications.
wss://api.sha224.com/v2/ws?api_key=your_api_key
// Client -> Server
{
"action": "hash",
"id": "unique-request-id",
"data": "Text to hash",
"options": {
"encoding": "utf8",
"output": "hex"
}
}
// Server -> Client
{
"id": "unique-request-id",
"success": true,
"hash": "4149da18aa8bfc2b1e382c6c26556d01a92c261b6436dad5e3be3fcc",
"timestamp": "2024-01-15T10:30:45.123Z"
}
const ws = new WebSocket('wss://api.sha224.com/v2/ws?api_key=your_api_key');
ws.onopen = () => {
console.log('Connected to SHA-224 WebSocket');
// Send hash request
ws.send(JSON.stringify({
action: 'hash',
id: Date.now().toString(),
data: 'Hello, WebSocket!'
}));
};
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
console.log('Hash received:', response.hash);
};
ws.onerror = (error) => {
console.error('WebSocket error:', error);
};
| Plan | Requests/Second | Requests/Day | Max File Size | WebSocket Connections |
|---|---|---|---|---|
| Free | 10 | 1,000 | 10 MB | 1 |
| Basic | 50 | 10,000 | 50 MB | 5 |
| Pro | 200 | 100,000 | 100 MB | 20 |
| Enterprise | Unlimited | Unlimited | 1 GB | Unlimited |
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1705318245
X-RateLimit-Retry-After: 60
Use our official SDKs for quick integration with your favorite programming language.
# Python
pip install sha224-api
# JavaScript/Node.js
npm install @sha224/api-client
# Go
go get github.com/sha224/go-sdk
# Ruby
gem install sha224-api
# PHP
composer require sha224/api-client
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | Invalid or missing required parameters |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 401 | EXPIRED_KEY | API key has expired |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests |
| 413 | FILE_TOO_LARGE | File exceeds maximum size limit |
| 500 | INTERNAL_ERROR | Internal server error |
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "API rate limit exceeded",
"details": "You have exceeded the rate limit of 10 requests per second",
"retry_after": 60
}
}
import requests
import json
class SHA224Client:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.sha224.com/v2"
self.headers = {
"X-API-Key": api_key,
"Content-Type": "application/json"
}
def hash_text(self, text):
"""Generate SHA-224 hash for text"""
response = requests.post(
f"{self.base_url}/hash",
headers=self.headers,
json={"data": text}
)
return response.json()
def hash_file(self, file_path):
"""Generate SHA-224 hash for file"""
with open(file_path, 'rb') as f:
response = requests.post(
f"{self.base_url}/file",
headers={"X-API-Key": self.api_key},
files={"file": f}
)
return response.json()
def batch_hash(self, items):
"""Generate multiple hashes"""
response = requests.post(
f"{self.base_url}/batch",
headers=self.headers,
json={"items": items}
)
return response.json()
# Usage
client = SHA224Client("your_api_key")
# Hash text
result = client.hash_text("Hello, World!")
print(f"Hash: {result['hash']}")
# Hash file
result = client.hash_file("document.pdf")
print(f"File hash: {result['hash']}")
# Batch processing
items = [
{"id": "1", "data": "First text"},
{"id": "2", "data": "Second text"}
]
results = client.batch_hash(items)
for item in results['results']:
print(f"ID {item['id']}: {item['hash']}")
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
class SHA224Client {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseURL = 'https://api.sha224.com/v2';
this.headers = {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
};
}
async hashText(text) {
try {
const response = await axios.post(
`${this.baseURL}/hash`,
{ data: text },
{ headers: this.headers }
);
return response.data;
} catch (error) {
console.error('Error:', error.response.data);
throw error;
}
}
async hashFile(filePath) {
const form = new FormData();
form.append('file', fs.createReadStream(filePath));
try {
const response = await axios.post(
`${this.baseURL}/file`,
form,
{
headers: {
'X-API-Key': this.apiKey,
...form.getHeaders()
}
}
);
return response.data;
} catch (error) {
console.error('Error:', error.response.data);
throw error;
}
}
async verifyHash(data, hash) {
try {
const response = await axios.post(
`${this.baseURL}/verify`,
{ data, hash },
{ headers: this.headers }
);
return response.data;
} catch (error) {
console.error('Error:', error.response.data);
throw error;
}
}
}
// Usage
const client = new SHA224Client('your_api_key');
// Hash text
client.hashText('Hello, World!')
.then(result => console.log('Hash:', result.hash));
// Verify hash
client.verifyHash('Hello, World!', '4149da18aa8bfc2b1e382c6c26556d01a92c261b6436dad5e3be3fcc')
.then(result => console.log('Valid:', result.valid));