What does the Hash Generator do?
The Hash Generator allows software developers, security engineers, and DevOps practitioners to generate cryptographic checksums and message authentication codes (HMAC) online. It computes MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes simultaneously with Hexadecimal (Lowercase/Uppercase) and Base64 output options.
Core Concepts
Understanding Cryptographic Hash Algorithms:
- SHA-256 (256-bit): Standard secure hash function widely used for API signature generation, file integrity verification, and SSL certificates.
- SHA-512 (512-bit): High-security hash algorithm providing 512-bit output digests.
- HMAC (Hash-based Message Authentication Code): Uses a shared secret key combined with a cryptographic hash function to verify data integrity and authenticity (common in webhooks and API authentication).
- MD5 & SHA-1: Fast legacy algorithms used for quick checksum verifications and non-cryptographic unique identifier generation.
How to use the tool?
- Input Text: Enter or paste any string into the Input Text String text area.
- Configure Format & Key: Select Lowercase Hex, Uppercase Hex, or Base64 format. Optionally enter a secret key for HMAC.
- Copy Hashes: Click
Copynext to any algorithm digest (MD5, SHA-1, SHA-256, SHA-384, SHA-512).
Related Developer Utilities
If you work with Linux, cloud security, or API integrations, explore these complementary tools:
- SSH Key Converter: Convert SSH keys between OpenSSH, PEM, and PKCS#8 formats.
- JWT Expiry Checker: Inspect JWT token payload, expiration times, and headers.
REST API Integration
Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/linux/hash-generator) to programmatically calculate cryptographic hashes and HMAC signatures.
API Request Parameters
| Name | Type | Description | Example |
|---|---|---|---|
text |
String | Input text string to hash. | "Hello World" |
secretKey |
String | (Optional) Shared secret key for HMAC. | "secret-key" |
format |
String | Output format: "hex_lower", "hex_upper", or "base64". Default "hex_lower". |
"hex_lower" |
API Request Payload Examples
cURL
curl -X POST https://blueutils.com/api/linux/hash-generator \
-H "Content-Type: application/json" \
-d '{
"text": "Hello World",
"format": "hex_lower"
}'Python
import requests
url = "https://blueutils.com/api/linux/hash-generator"
payload = {
"text": "Hello World",
"format": "hex_lower"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String jsonPayload = """
{
"text": "Hello World",
"format": "hex_lower"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://blueutils.com/api/linux/hash-generator"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}API Response Parameters
| Name | Type | Description | Example |
|---|---|---|---|
isValid |
Boolean | Indicates whether hash calculation succeeded. | true |
isHmac |
Boolean | Indicates whether secret key was used for HMAC. | false |
format |
String | Output encoding format used. | "hex_lower" |
hashes |
Object | Map of calculated digests (md5, sha1, sha256, sha384, sha512). |
{ "sha256": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e" } |
API Response Payload Examples
Success Response (HTTP 200 OK)
{
"isValid": true,
"text": "Hello World",
"isHmac": false,
"format": "hex_lower",
"hashes": {
"md5": "b10a8db164e0754105b7a99be72e3fe5",
"sha1": "0a4d55a8d778e5022fab701977c5d840bbc486d0",
"sha256": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e",
"sha384": "99514329186b2f6ae4a1329e7ee6c610a729636335174ac4b7cb65fc60d6538f8e8b2a41c6e4804506b225c6594f800b",
"sha512": "2c74d109476d213bed8bc5f23b615d0a9c09985d23ed67b05a00ed49641291f637731a5477d13f9f91a5477d13f9f91a"
}
}Validation Failure Response (HTTP 400 Bad Request)
{
"isValid": false,
"error": "Invalid input: Text parameter is required."
}Rate Limit Exceeded Response (HTTP 429 Too Many Requests)
{
"error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}Why use an API to generate Hashes?
Integrating the Hash Generator API into automation tools and CI/CD pipelines offers multiple key advantages:
- Automated Artifact Verification: Generate SHA-256 digests of files and payloads before deploying to production.
- Webhook HMAC Signing: Programmatically compute HMAC signatures to authenticate API webhook requests.
Native Usage
How to generate cryptographic hashes programmatically across programming environments:
Node.js (JavaScript)
const crypto = require('crypto');
function sha256(text) {
return crypto.createHash('sha256').update(text).digest('hex');
}
console.log(sha256('Hello World'));Windows (PowerShell Script)
$string = "Hello World"
$bytes = [System.Text.Encoding]::UTF8.GetBytes($string)
$hash = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes)
[System.BitConverter]::ToString($hash).Replace("-", "").ToLower()Linux (Bash Shell)
echo -n "Hello World" | sha256sum | awk '{print $1}'Python
import hashlib
def sha256(text):
return hashlib.sha256(text.encode('utf-8')).hexdigest()
print(sha256("Hello World"))Java
import java.security.MessageDigest;
public class HashExample {
public static void main(String[] args) throws Exception {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest("Hello World".getBytes("UTF-8"));
StringBuilder hexString = new StringBuilder();
for (byte b : hash) {
hexString.append(String.format("%02x", b));
}
System.out.println(hexString.toString());
}
}