DevOnlineTools

Hash Generator (SHA-256, SHA-512, SHA-1, MD5)

Generate cryptographic checksums instantly from plain text or uploaded files using SHA-256, SHA-512, SHA-384, SHA-1, and MD5 hashing algorithms.

devonlinetools://security/hash-generator
⌘ + EnterRun / Format
Shortcuts Active

Code Snippets & Examples

Copy-paste ready code implementations for your project:

JavaScript (Web Crypto API)
async function sha256(message) {
  const msgUint8 = new TextEncoder().encode(message);
  const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
  const hashArray = Array.from(new Uint8Array(hashBuffer));
  return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
Python 3
import hashlib

# Compute SHA-256
digest = hashlib.sha256(b'Hello World').hexdigest()
print(digest)
Bash CLI
echo -n "Hello World" | sha256sum

Frequently Asked Questions

What is a cryptographic hash function?

A cryptographic hash function takes an arbitrary input string and produces a fixed-size, deterministic byte string (digest). It is a one-way function — given a hash, it is computationally impossible to invert back to the original text.

Is MD5 or SHA-1 safe for security?

No. MD5 and SHA-1 have known collision vulnerabilities and are considered broken for security applications. Use SHA-256, SHA-512, or Bcrypt for password hashing.