วิธีสร้างค่าแฮชทีละขั้นตอน
Quick Answer
วิธีสร้าง hash: เปิด Hash Generator, เลือก algorithm (แนะนำ SHA-256), ใส่ข้อความ hash digest จะปรากฏทันที เครื่องมือใช้ Web Crypto API (crypto.subtle.digest) การประมวลผลเกิดในเครื่อง
Introduction
ฟังก์ชัน hash รับ input ขนาดใดๆ ผลิต output ขนาดคงที่เรียก hash หรือ digest ฟังก์ชัน hash cryptography เช่น SHA-256 มีคุณสมบัติพิเศษ: input เดียวกันได้ output เดียวกัน, input ต่างกันได้ output ต่างกัน (collision resistance), และย้อนกลับไม่ได้ (one-way) hash ใช้ตรวจ integrity เก็บพาสเวิร์ด และ signature ดิจิทัล
Step by Step
-
Open the Hash Generator tool
Go to the Hash Generator tool page. The tool supports multiple algorithms: SHA-256, SHA-384, SHA-512, SHA-1, and MD5.
-
Select the hash algorithm
Choose SHA-256 for most use cases — it is the modern standard, widely supported, and has no known vulnerabilities. Use SHA-512 for extra security. Avoid MD5 and SHA-1 for security-sensitive uses; they are broken for collision resistance.
-
Enter your input text
Paste or type the text you want to hash into the input field. The tool hashes the UTF-8 encoded bytes of your input.
-
Read the hash digest
The tool computes the hash using crypto.subtle.digest() (for SHA) and displays the hex-encoded digest. SHA-256 produces a 64-character hex string. The result appears instantly.
-
Copy the hash
Click Copy to copy the hash digest to your clipboard. Use it for file integrity checks, password storage (with a salt and key stretching), or data deduplication.
Examples
SHA-256 hash of text
Input: Hello, World!
Output: dffd6021bb2bd5b0af676290809ec008dfca50a8d29e6ac0a52c2d7e9f0a3b0c
SHA-256 hash of empty string
Input:
Output: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
MD5 hash (legacy, not for security)
Input: Hello, World!
Output: ed0760733d7505e9ceacf8af225020ac
Common Problems
- Using MD5 or SHA-1 for security —both are broken for collision resistance. Use SHA-256 or stronger for any security purpose.
- Hashing passwords without a salt —identical passwords produce identical hashes, enabling rainbow table attacks. Use bcrypt, scrypt, or Argon2 with a unique salt.
- Expecting hashes to be reversible —cryptographic hashes are one-way. You cannot recover the input from the hash.
- Case sensitivity —hex hashes are typically lowercase. Compare hashes case-insensitively or normalize before comparing.
Tips
- Use SHA-256 for data integrity verification, content addressing, and digital signatures.
- For password storage, use bcrypt, scrypt, or Argon2 —not raw SHA-256. These algorithms have key stretching to resist brute force.
- Use the Web Crypto API (crypto.subtle.digest) in browsers for secure, native hashing —no libraries needed.
- Use our Hash Generator for instant, private hashing —your input never leaves your browser.