Generador de hash

Genera hashes MD5, SHA-1, SHA-256, SHA-384 y SHA-512.

// about

Sobre esta herramienta

Un hash es como la huella digital de un texto. Sin importar el tamaño de tu mensaje, lo convierte en un código de longitud fija. Genera hashes MD5, SHA-1, SHA-256 y SHA-512.

Cómo usarla

  1. Escribe o pega tu texto en el cuadro.
  2. Selecciona el algoritmo de hash que prefieras.
  3. Haz clic en 'Generar' y copia el código obtenido.

Por qué usar esta herramienta

  • Comprueba si dos textos o archivos son exactamente iguales.
  • Soporta los algoritmos más usados como SHA-256 y MD5.
  • Calcula hashes de seguridad de forma instantánea.

Preguntas frecuentes (FAQ)

¿Se puede recuperar el texto original desde el hash?

¡No! Las funciones hash son de una sola vía y no se pueden revertir.

¿Para qué se usa SHA-256?

Se usa en ciberseguridad, certificados digitales y para comprobar descargas.

¿Es seguro MD5 para contraseñas?

MD5 sirve para comprobaciones rápidas, pero para seguridad se recomienda SHA-256.

Guías · Seguridad · 8 min de lectura

Funciones hash explicadas de forma sencilla: MD5, SHA-1 o SHA-256 y cómo usarlas

Las sumas de comprobación de descargas, los ID de commit de Git y las direcciones de blockchain son valores hash. Esta guía explica en qué se diferencia el hash del cifrado y qué algoritmo elegir para cada tarea.

Una función hash toma una entrada de cualquier longitud y produce un valor corto de longitud fija, llamado hash o resumen. Tanto si aplicas el hash a una palabra como a un vídeo de varios gigabytes, SHA-256 siempre devuelve 256 bits, es decir, 64 caracteres hexadecimales.

SHA-256("hello")  = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
SHA-256("hello!") = ce06092fb948d9ffac7d1a376e404b26b7575bcc11ee05a4615fef4fec3a308b
MD5("hello")      = 5d41402abc4b2a76b9719d911017c592
Las propiedades de un buen hash, por qué MD5 y SHA-1 ya no son seguros y cómo usar hashes para la integridad de archivos y las contraseñas.
Leer guía →
Créalo con IA

Crea esta herramienta tú mismo con IA

¿Quieres tu propia versión? Copia el prompt en un chat de IA o guarda el archivo de skill para un agente de programación. Incluyen las funciones, casos límite y pruebas que usamos al crearla.

El prompt y la skill están en inglés, que las herramientas de IA entienden perfectamente.

Prompt de instrucciones para IA

Pégalo tal cual en Claude, ChatGPT o Gemini.

You are an experienced full-stack web developer. Build a web tool called "Generador de hash" that meets the requirements below.

## Goal

Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.

## Core features

- Show several algorithms at once
- Output as lower/upper-case hex or Base64
- HMAC mode with a secret key
- Compare two hash values
- Copy button for each result

## Inputs

- Text to hash
- Output format and optional HMAC key

## Outputs

- Hash per algorithm
- Comparison result (match/mismatch)

## Edge cases and handling rules

- Hash the empty string correctly
- Explain that CRLF versus LF line endings change the hash
- Keep the UI responsive for large inputs
- Warn that MD5 and SHA-1 are unsuitable for security

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- SHA-256('hello') = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
- MD5('hello') = 5d41402abc4b2a76b9719d911017c592
- 'Hello' and 'hello' produce different hashes

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

Skill (SKILL.md)

Guárdalo como .claude/skills/build-hash-generator/SKILL.md para que agentes como Claude Code lo reutilicen cada vez que crees o cambies la herramienta.

---
name: build-hash-generator
description: Use when building or changing a Generador de hash tool. Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.
---

# Build: Generador de hash

## Goal

Build a tool that computes MD5, SHA-1, SHA-256 and SHA-512 hashes of text in one go.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- Show several algorithms at once
- Output as lower/upper-case hex or Base64
- HMAC mode with a secret key
- Compare two hash values
- Copy button for each result

## Inputs

- Text to hash
- Output format and optional HMAC key

## Outputs

- Hash per algorithm
- Comparison result (match/mismatch)

## Rules

- Hash the empty string correctly
- Explain that CRLF versus LF line endings change the hash
- Keep the UI responsive for large inputs
- Warn that MD5 and SHA-1 are unsuitable for security
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] SHA-256('hello') = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
- [ ] MD5('hello') = 5d41402abc4b2a76b9719d911017c592
- [ ] 'Hello' and 'hello' produce different hashes

Consejos para trabajar con IA

  • Indica tu stack (React, Vue o HTML puro) en la primera línea para obtener código adecuado.
  • Pide que ejecute las pruebas listadas y muestre los resultados antes de aceptar el código.
  • No pegues contraseñas reales, datos de clientes ni claves de API; usa valores de ejemplo.