Text Hasher Skill
Quickly hash a text string with SHA-256 or MD5.
When to Use
- Verify content integrity after a copy/paste or download
- Generate a fingerprint for deduplication
- Confirm two pieces of text are identical
Prerequisites
sha256sumormd5sum(usually preinstalled on Linux/macOS)
Steps
- Hash text inline:
echo -n "your text here" | sha256sum | awk '{print $1}' - Or MD5:
echo -n "your text here" | md5sum | awk '{print $1}' - Compare two hashes with diff:
diff <(echo -n "text A" | sha256sum) <(echo -n "text B" | sha256sum) - Hash from stdin (pipe-friendly):
cat data.txt | sha256sum | awk '{print $1}'
Notes
-nonechoprevents a trailing newline from changing the hash.- For large files use
sha256sum filenamedirectly.
