text.hash
fingerprints of text: SHA and MD5 hashes, HMAC signatures, CRC-32 checksums
Fingerprints of text. A hash turns any text into a short fixed-length value, shown as hex. The same input always gives the same hash, and the smallest change gives a completely different one, so hashes are used to check that data hasn’t changed.
good to know
Section titled “good to know”SHA-256 and SHA-512 are secure. MD5 and SHA-1 are broken for security purposes but still fine as checksums, and CRC-32 only catches accidental damage.
Tags: crypto
sha1the SHA-1 hash, in hexsha256the SHA-256 hash, in hexsha512the SHA-512 hash, in hexmd5the MD5 hash, in hexhmacthe HMAC of s with the secret key, in hexhash_idwhat kind of hash this looks like, from its length and format, likeliest firsthash_matchthe candidate whose hash is this one, or nil, hashing each with every algorithm hash_id suggests that zil hascrc32the CRC-32 checksum, as an integer, the same one zip files and PNG images use
Functions
Section titled “Functions”sha1(s: str) -> str
the SHA-1 hash, in hex
1"hello".sha1"aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d"See also sha256
sha256
Section titled “sha256”sha256(s: str) -> str
the SHA-256 hash, in hex
1"hello".sha256[..16]"2cf24dba5fb0a30e"sha512
Section titled “sha512”sha512(s: str) -> str
the SHA-512 hash, in hex
1"hello".sha512[..16]"9b71d224bd62f378"See also sha256
md5(s: str) -> str
the MD5 hash, in hex
1"hello".md5"5d41402abc4b2a76b9719d911017c592"See also sha256
hmac(s: str, key: str, alg: str = “sha256”) -> str
the HMAC of s with the secret key, in hex
A hash mixed with the key, so only someone with the key can produce it, which is how APIs sign messages and webhooks. alg is the hash to use: “sha256”, “sha1”, “sha384”, “sha512” or “md5”
1hmac("msg", "secret")"fe4f9c418f683f034f6af90d1dd5b86ac0355dd96332c59cc74598d0736107f6"2hmac("msg", "secret", "sha1")"ca3efb15cfaf530e0d771e5cbe707104f006b257"See also sha256
hash_id
Section titled “hash_id”hash_id(hash: str) -> list
what kind of hash this looks like, from its length and format, likeliest first
Hex digests are told apart only by length, so 32 hex digits could be MD5, NTLM or MD4. Crypt-style hashes like $2b$… (bcrypt) and $6$… (SHA-512 crypt) are recognized by their prefix. Empty when nothing fits
1hash_id("5d41402abc4b2a76b9719d911017c592")["md5", "ntlm", "md4"]2hash_id("$2b$12$abcdefghijklmnopqrstuuJ2WBHnL3eYDKZJ6XtAlr3yXlJ9z8u2G")["bcrypt"]See also hash_match, md5
hash_match
Section titled “hash_match”hash_match(hash: str, candidates: list) -> str|nil
the candidate whose hash is this one, or nil, hashing each with every algorithm hash_id suggests that zil has
Works for MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hex digests, upper or lower case. A small dictionary attack, for when a puzzle hands you a hash and a word list
1hash_match("5d41402abc4b2a76b9719d911017c592", ["hi", "hello", "hey"])"hello"crc32(v: str|list|bytes) -> int
the CRC-32 checksum, as an integer, the same one zip files and PNG images use
1"hello".crc329070608702"hello".crc32 to hex0x3610a686More examples
Section titled “More examples”1# the MD5 hash of hello2"hello".md5"5d41402abc4b2a76b9719d911017c592"3# a CRC-32 checksum in hex4"hello".crc32 to hex0x3610a6865# sign a message with a secret key6hmac("msg", "secret")"fe4f9c418f683f034f6af90d1dd5b86ac0355dd96332c59cc74598d0736107f6"Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.