ShieldX Toolly
Open a tool Donate
Home Home
Blog Blog
FAQ FAQ
Open a tool Donate
Back to cheatsheets
Cryptography

Hash Type Identification

Detect hash types by length and format patterns — MD5, SHA-1, SHA-256, bcrypt, Argon2, and more.

1 snippet Beginner hash-identifier
hash identificationMD5SHA-256bcryptArgon2

What you'll learn

  • Identify by length and pattern

How to use these snippets

  1. Click the Copy button next to any snippet to copy it to your clipboard.
  2. Paste the code into your project, IDE, or terminal.
  3. Replace placeholder values (like example.com or your-secret) with your actual data.
  4. Review the code comments for important security notes and caveats.
  5. Try the interactive related tool to see the concept in action.
Code Snippets

Copy-paste code snippets

1 ready-to-use snippets for hash type identification. Click copy and paste into your project.

Identify by length and pattern
                function identifyHash(hash) {
  const h = hash.trim();
  const results = [];

  // By length
  const byLength = {
    32: 'MD5',
    40: 'SHA-1',
    56: 'SHA-224',
    64: 'SHA-256',
    96: 'SHA-384',
    128: 'SHA-512',
  };

  if (byLength[h.length] && /^[0-9a-f]+$/i.test(h)) {
    results.push({ type: byLength[h.length], confidence: 'high' });
  }

  // By format
  if (/^\$2[abxy]\$\d{2}\$/.test(h))
    results.push({ type: 'bcrypt', confidence: 'high' });
  if (/^\$argon2[id]?\$/.test(h))
    results.push({ type: 'Argon2', confidence: 'high' });
  if (/^[0-9a-f]{32}:[0-9a-f]+$/i.test(h))
    results.push({ type: 'NTLM (hash:salt)', confidence: 'medium' });

  return results;
}
              
Tool

Try this concept hands-on with the interactive tool.

100% Free · No signup · No cost

Generate something unguessable right now

148 bits of entropy, a crack-time estimate you can trust, and a clipboard that clears itself after 30 seconds.

Open the toolkit

Part of the Toolly ecosystem · secure.toolly.site