Hash Workflow
Hash Alfred Workflow to quickly hash, encode and decode strings. Selecting a result copies it to the clipboard.
Requirements
N/A
Installation
- Download hash-workflow.alfredworkflow from the repo's releases section
- Install in Alfred (double-click)
Setup (building the workflow manually)
- Script Filter with keyword
hash, argument optional, input asargv, script./hash-workflow "$1". Quoting"$1"preserves the input's whitespace exactly. The "with space" option can be on or off: one leading space, the separator after the keyword, is ignored. - Connect it to a
Copy to Clipboardoutput with{query}.
Usage
-
hash <string>hashes and encodes the string. The default mode is encode. -
hash e <string>does the same, with encode mode stated explicitly. Use it to hash a string that itself starts withdore, e.g.hash e d doghashesd dog. -
hash d <string>decodes the string. Only decoders matching the input's shape are tried. Hex means an even number of0-9a-fcharacters, Base64 uses its own alphabet, and URL decoding needs a%XXescape. Results are shown only if they decode to printable UTF-8. -
hash e/<algo> <string>/hash d/<algo> <string>limit the output to one algorithm or a family.:also works as the separator (e:sha256). Matching ignores case.- An exact name or alias picks that one algorithm; separators are optional. Examples:
sha256,SHA-256,b64,base64url,url. - Otherwise every algorithm whose name starts with the given prefix is shown. For example,
sha3gives SHA3-256 and SHA3-512. - Naming a decoder skips the shape check, so
hash d/b64 a000decodes as base64 even though the input looks like hex. - Before typing the input,
hash e/<prefix>orhash d/<prefix>lists the matching algorithms.hash e/orhash d/lists all of them. Pressing ↵ or ⇥ on one autocompletes it, e.g. tohash e/sha-256. hash e e/sha256 xhashes the literal stringe/sha256 x.
- An exact name or alias picks that one algorithm; separators are optional. Examples:
Whitespace in the input is never trimmed. The input is hashed exactly as typed.
| Encode | Decode |
|---|---|
| SHA-256, SHA-1, MD5 | Base64 |
| Base64, Base64 URL-safe (no padding) | Base64 URL-safe (padding optional) |
| Hex | Hex |
| URL percent-encoding | URL percent-decoding |
| SHA-512, SHA-384, SHA3-256, SHA3-512 | |
| BLAKE2b-512, BLAKE3, CRC32 |