pinkhash


Namepinkhash JSON
Version 0.0.7 PyPI version JSON
download
home_pageNone
SummaryConvert any hash/data into human-friendly memorable phrase (numerous ways)
upload_time2024-10-18 08:54:26
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords bip39 icao nato rfc1751 convert elephant english hash memorize mnemonic natural natural language pink pinkelephant pinkhash vivid words
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

If a hash is converted into words, people will remember it much better:
- `alter print drive` *// bip39 with `en` option by default, but we have `fr`, `es`, `pt`, `it`, `ko`, `cz`, `zh-hant` and `zh-hans` as well*
- `WELL LANE HELD` *// rfc1751*
- `configurational candidate` *// eng1*
- `Uniform X-ray November` *// nato*


## Installation

recommended way (you may want to `apt install pipx` for this):
~~~
pipx install pinkhash
~~~

or older way:
~~~
pip install pinkhash
~~~

## CLI Usage
~~~shell
# get pink hash for stdin, default mode with bip39/en
$ echo "Hello world!" | pink 
hybrid interest chimney

# or in French...
$ echo "Hello world!" | pink  -o fr
gazelle griffure caméra

# Nato alphabet, 5 words
$ echo "Hello world!" | pink  -l nato -w 5
Charlie Zulu Tango Juliett Oscar

# eng1 always returns 2 words, no matter how many we ask
$ echo "Hello world!" | pink  -l eng1 -w 42
chief clioquinol
~~~

How to get pinkhash for files:
~~~shell
# pink can hash many files
$ pink *txt
cookies.txt: pelican number item
DNS.txt: shadow expire inhale
log.txt: absurd now caution
~~~

## Python usage

Get pinkhash for a `str` with all default settings (Bip39 language as default).
~~~python
from pinkhash import PinkHash
pink = PinkHash()
print(pink.convert('Hello world!'))
~~~

~~~python
from pinkhash import PinkHash
import sys

pink = PinkHash(language_name='nato', nwords=3)
data = sys.stdin.buffer.read()
r = pink.convert(data)
print(r)
~~~

## Languages
Each method to convert hash into words in Pinkhash is called an *language*. For example, `nato` is one language and `rfc1751` is another language. Do not confuse this with a national language. Pinkhash now has built-in `eng1` language (which produces adjective+noun pair from large set of english words) but in future there could be another *english* language, e.g. one which uses only simple popular words, or one which builds longer phrases or one which produces poems or haiku. 

Usually (but not always) language can produce hashes of specified (`-w`) number of words, but `eng1` never produces more then 2 words. Also pinkhash will not produce more words then needed to cover only lower 64bits of sha1 hash of input.

`BIP-39` language (based on [BIP-0039](https://github.com/bitcoin/bips/tree/master/bip-0039)) has 10 *options* (wordlists), choose it with `-o`. See all options with `-h`/`--help`.

## Disclaimer
While pinkhash uses `RFC1751` and `BIP-0039`, it's not strictly following it! Pinkhash has it's own algorithms and just uses wordlists from these standards. Do not use pinkhash where you need strict standard compliance.

Mnemonical pink hashes are NOT cryptographically strong.

## Contributions
Contributions are welcome! Write me to yaroslaff / gmail.com to discuss or make a ticket and/or PR.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pinkhash",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "BIP39, ICAO, NATO, RFC1751, convert, elephant, english, hash, memorize, mnemonic, natural, natural language, pink, pinkelephant, pinkhash, vivid, words",
    "author": null,
    "author_email": "Yaroslav Polyakov <yaroslaff@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2c/c2/cade4c744331850bc22784d57b4d019395c62912811bbbaf0741a5a163f5/pinkhash-0.0.7.tar.gz",
    "platform": null,
    "description": "# Pink Hash\n\n*It's like a pink elephant, but a hash*\n\nConvert hashes to mnemonic phrases.\n\nHashes 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.\n\nHowever, humans aren\u2019t entirely useless \u2014 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\u2019ll still be thinking about the pink elephant.\n\nIf a hash is converted into words, people will remember it much better:\n- `alter print drive` *// bip39 with `en` option by default, but we have `fr`, `es`, `pt`, `it`, `ko`, `cz`, `zh-hant` and `zh-hans` as well*\n- `WELL LANE HELD` *// rfc1751*\n- `configurational candidate` *// eng1*\n- `Uniform X-ray November` *// nato*\n\n\n## Installation\n\nrecommended way (you may want to `apt install pipx` for this):\n~~~\npipx install pinkhash\n~~~\n\nor older way:\n~~~\npip install pinkhash\n~~~\n\n## CLI Usage\n~~~shell\n# get pink hash for stdin, default mode with bip39/en\n$ echo \"Hello world!\" | pink \nhybrid interest chimney\n\n# or in French...\n$ echo \"Hello world!\" | pink  -o fr\ngazelle griffure came\u0301ra\n\n# Nato alphabet, 5 words\n$ echo \"Hello world!\" | pink  -l nato -w 5\nCharlie Zulu Tango Juliett Oscar\n\n# eng1 always returns 2 words, no matter how many we ask\n$ echo \"Hello world!\" | pink  -l eng1 -w 42\nchief clioquinol\n~~~\n\nHow to get pinkhash for files:\n~~~shell\n# pink can hash many files\n$ pink *txt\ncookies.txt: pelican number item\nDNS.txt: shadow expire inhale\nlog.txt: absurd now caution\n~~~\n\n## Python usage\n\nGet pinkhash for a `str` with all default settings (Bip39 language as default).\n~~~python\nfrom pinkhash import PinkHash\npink = PinkHash()\nprint(pink.convert('Hello world!'))\n~~~\n\n~~~python\nfrom pinkhash import PinkHash\nimport sys\n\npink = PinkHash(language_name='nato', nwords=3)\ndata = sys.stdin.buffer.read()\nr = pink.convert(data)\nprint(r)\n~~~\n\n## Languages\nEach method to convert hash into words in Pinkhash is called an *language*. For example, `nato` is one language and `rfc1751` is another language. Do not confuse this with a national language. Pinkhash now has built-in `eng1` language (which produces adjective+noun pair from large set of english words) but in future there could be another *english* language, e.g. one which uses only simple popular words, or one which builds longer phrases or one which produces poems or haiku. \n\nUsually (but not always) language can produce hashes of specified (`-w`) number of words, but `eng1` never produces more then 2 words. Also pinkhash will not produce more words then needed to cover only lower 64bits of sha1 hash of input.\n\n`BIP-39` language (based on [BIP-0039](https://github.com/bitcoin/bips/tree/master/bip-0039)) has 10 *options* (wordlists), choose it with `-o`. See all options with `-h`/`--help`.\n\n## Disclaimer\nWhile pinkhash uses `RFC1751` and `BIP-0039`, it's not strictly following it! Pinkhash has it's own algorithms and just uses wordlists from these standards. Do not use pinkhash where you need strict standard compliance.\n\nMnemonical pink hashes are NOT cryptographically strong.\n\n## Contributions\nContributions are welcome! Write me to yaroslaff / gmail.com to discuss or make a ticket and/or PR.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Convert any hash/data into human-friendly memorable phrase (numerous ways)",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/yaroslaff/pinkhash",
        "Issues": "https://github.com/yaroslaff/pinkhash/issues"
    },
    "split_keywords": [
        "bip39",
        " icao",
        " nato",
        " rfc1751",
        " convert",
        " elephant",
        " english",
        " hash",
        " memorize",
        " mnemonic",
        " natural",
        " natural language",
        " pink",
        " pinkelephant",
        " pinkhash",
        " vivid",
        " words"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "36ea4b3ddf99303d4f7a9fd405f7f411c580401cc3f3932ee93c607b78df16a6",
                "md5": "980058eabd09fdad7463ec2a86c38e3b",
                "sha256": "b725bba194debea3ad535c11a732aa780956b30f606743bdfb0054b9039fd4f1"
            },
            "downloads": -1,
            "filename": "pinkhash-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "980058eabd09fdad7463ec2a86c38e3b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 325016,
            "upload_time": "2024-10-18T08:54:28",
            "upload_time_iso_8601": "2024-10-18T08:54:28.858524Z",
            "url": "https://files.pythonhosted.org/packages/36/ea/4b3ddf99303d4f7a9fd405f7f411c580401cc3f3932ee93c607b78df16a6/pinkhash-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2cc2cade4c744331850bc22784d57b4d019395c62912811bbbaf0741a5a163f5",
                "md5": "6e2567dc272e771d82475c20604e58b3",
                "sha256": "8d1a7b0d0bf3081a5353f0db04b37e829fe5969ba362359fa22c007d18bfeeb2"
            },
            "downloads": -1,
            "filename": "pinkhash-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "6e2567dc272e771d82475c20604e58b3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 324483,
            "upload_time": "2024-10-18T08:54:26",
            "upload_time_iso_8601": "2024-10-18T08:54:26.377326Z",
            "url": "https://files.pythonhosted.org/packages/2c/c2/cade4c744331850bc22784d57b4d019395c62912811bbbaf0741a5a163f5/pinkhash-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-18 08:54:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yaroslaff",
    "github_project": "pinkhash",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pinkhash"
}
        
Elapsed time: 0.34587s