HashSnap

Theme:

Instant password hashing — right in your browser.

🔓

What is a salt?
A salt is a random string added to your password before hashing. It makes hashes stronger and prevents attackers from using precomputed lists.

Hash length: —
🔒
Hash time: — ms

How to Use This Hash in Your Website

You can store this hash instead of the real password. When a user logs in, hash their input the same way and compare it to the stored hash.


// Example (JavaScript)
const storedSalt = "SOME_SALT";
const storedHash = "PASTE_HASH_HERE";

async function hashPassword(password, salt) {
    const encoder = new TextEncoder();
    const data = encoder.encode(salt + password);
    const hashBuffer = await crypto.subtle.digest("SHA-256", data);
    const hashArray = Array.from(new Uint8Array(hashBuffer));
    return hashArray.map(b => b.toString(16).padStart(2, "0")).join("");
}

async function verifyPassword(inputPassword) {
    const inputHash = await hashPassword(inputPassword, storedSalt);
    return inputHash === storedHash;
}
        

This is how websites safely check passwords without ever storing the real one.

Security Notes