Convert any hash/data into human-friendly phrase (numerous ways)
Project description
Pink Hash
It's like a pink elephant, but a hash
Convert hashes to mnemonic phrases.
Hashes are great for many machine-specific purposes, but if you give a hash to a person (e.g., display it on a console), you're doing something wrong. Humans struggle with remembering, comparing, or typing hashes accurately. For most people, 8f776debaf8b5031643aa463ba5bf0dc
and 8f776debaf8b5013643aa463ba5bf0dc
look essentially the same.
However, humans aren’t entirely useless — they can remember vivid phrases quite well. If you tell someone not to think about a pink elephant or a white monkey, and then Margot Robbie calls to ask them out on a date, even after spending the entire evening and night with her, they’ll still be thinking about the pink elephant.
WELL LANE HELD
or Uniform Xray November
is much easier for numan to remember.
Examples
$ echo -n pinkhash | md5sum
8f776debaf8b5031643aa463ba5bf0dc -
$ echo -n pinkhash | pink -a nato
Uniform Xray November
$ echo -n pinkhash | pink
WELL LANE HELD
Installation
recommended way (you may want to apt install pipx
for this):
pipx install pinkhash
or older way:
pip install pinkhash
CLI Usage
# get pink hash for any file as stdin stream
$ pink < /tmp/1M
# get 5-words pink hash with NATO alphabet
$ pink -a nato -w 5 < /tmp/1M
Hotel Yankee Zulu Papa Hotel
# eng1 never returns more then 2 words
$ pink -a eng1 < /tmp/1M
paraboloidal teapot
Python usage
Get pinkhash for a str
with all default settings (RFC1751 alphabet).
from pinkhash import PinkHash
pink = PinkHash()
print(pink.convert('Hello world!'))
from pinkhash import PinkHash
import sys
pink = PinkHash(alphabet_name='nato', nwords=3)
data = sys.stdin.buffer.read()
r = pink.convert(data)
print(r)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.