Files
hasher/QUICK_REFERENCE.md
2025-12-04 00:58:40 +01:00

3.2 KiB

Hasher - Quick Reference Card

🚀 Quick Commands

Development

npm run dev          # Start development server (http://localhost:3000)
npm run build        # Build for production
npm start            # Start production server
npm run lint         # Run ESLint

Bulk Indexing

npm run index-file <file>                    # Index wordlist file
npm run index-file <file> -- --batch-size N  # Custom batch size
npm run index-file -- --help                 # Show help

🔍 Hash Detection Patterns

Type Length Example
MD5 32 5f4dcc3b5aa765d61d8327deb882cf99
SHA1 40 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
SHA256 64 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
SHA512 128 b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb9...
Bcrypt 60 $2b$10$N9qo8uLOickgx2ZMRZoMye...

🔌 API Quick Reference

Search/Generate

POST /api/search
Content-Type: application/json
{ "query": "password" }

Health Check

GET /api/health

🌐 URLs

📊 Elasticsearch Commands

# Health
curl http://localhost:9200/_cluster/health?pretty

# Index stats
curl http://localhost:9200/hasher/_stats?pretty

# Document count
curl http://localhost:9200/hasher/_count?pretty

# Search
curl http://localhost:9200/hasher/_search?pretty

# Delete index (CAUTION!)
curl -X DELETE http://localhost:9200/hasher

🐛 Troubleshooting

Problem Solution
Can't connect to ES Check ELASTICSEARCH_NODE env var
Port 3000 in use Use PORT=3001 npm run dev
Module not found Run npm install
Build errors Run npm run build to see details

📁 Important Files

File Purpose
app/page.tsx Main UI component
app/api/search/route.ts Search endpoint
lib/elasticsearch.ts ES configuration
lib/hash.ts Hash utilities
scripts/index-file.ts Bulk indexer

⚙️ Environment Variables

# Required
ELASTICSEARCH_NODE=http://localhost:9200

# Optional
NODE_ENV=production

📝 Common Use Cases

Search for a hash

  1. Open http://localhost:3000
  2. Enter hash value
  3. Click Search

Generate hashes

  1. Open http://localhost:3000
  2. Enter plaintext
  3. Click Search
  4. Copy desired hash

Bulk index words

npm run index-file wordlist.txt

Check system health

curl http://localhost:3000/api/health

🎯 Sample Hashes (password)

  • MD5: 5f4dcc3b5aa765d61d8327deb882cf99
  • SHA1: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
  • SHA256: 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8

🆘 Get Help

npm run index-file -- --help  # Indexer help

Version: 1.0.0
Project: Hasher
License: MIT