Text Hash Generator API
Category: security
Generate MD5, SHA-256, SHA-384, and SHA-512 hashes from text. Runs entirely in the browser using Web Crypto API and js-md5.
Endpoint
N/A
Browser API (Web Crypto + js-md5)
No Server API
Response
Content-Type: N/A
This tool computes hashes in the browser using the Web Crypto API (SHA) and js-md5. No server-side API is available.
// Browser-only: uses Web Crypto API + js-md5
cURL Example
# No cURL equivalent — this tool runs in the browser
Code Samples
// Text hashing using Web Crypto API
const encoder = new TextEncoder();
const data = encoder.encode('Hello World');
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
const hashHex = Array.from(new Uint8Array(hashBuffer))
.map(b => b.toString(16).padStart(2, '0')).join('');
console.log('SHA-256:', hashHex);
// MD5 using js-md5
import md5 from 'js-md5';
console.log('MD5:', md5('Hello World'));
# Text hashing in Python:
import hashlib
text = 'Hello World'
print('MD5:', hashlib.md5(text.encode()).hexdigest())
print('SHA-256:', hashlib.sha256(text.encode()).hexdigest())
// Text hashing in Java:
import java.security.MessageDigest;
import java.util.HexFormat;
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] hash = md.digest("Hello World".getBytes());
System.out.println(HexFormat.of().formatHex(hash));