Computes a SHA-2 hash of the specified length. Supports SHA-224, SHA-256, SHA-384, and SHA-512.
VARCHARDiperbarui: 13 Jun 2026SHA2(str, hash_length)The string to hash
Hash length: 224, 256, 384, 512, or 0 (= 256)
1 SELECT SHA2('hello', 256) AS hash;
SHA-256 hash of 'hello'.
1 SELECT SHA2(CONCAT(password, salt), 512) AS password_hash 2 FROM users;
Secure password hashing with a salt.
1 SELECT id, SHA2(content, 256) AS fingerprint 2 FROM articles;
Generate a fingerprint for content.
Sudah paham SHA2? Latih langsung di browser
Latihan interaktif, langsung di browser.