Skip to main content

humanhash

humanhash provides human-readable representations of digests.

https://img.shields.io/travis/blag/humanhash.svg https://img.shields.io/coveralls/blag/humanhash.svg https://img.shields.io/pypi/v/humanhash3.svg https://img.shields.io/pypi/l/humanhash3.svg https://img.shields.io/pypi/pyversions/humanhash3.svg

Example

>>> import humanhash

>>> digest = '7528880a986c40e78c38115e640da2a1'
>>> humanhash.humanize(digest)
'three-georgia-xray-jig'
>>> humanhash.humanize(digest, words=6)
'high-mango-white-oregon-purple-charlie'

>>> humanhash.uuid()
('potato-oranges-william-friend', '9d2278759ae24698b1345525bd53358b')

Caveats

Don’t store the humanhash output, as its statistical uniqueness is only around 1 in 4.3 billion. Its intended use is as a human-readable (and, most importantly, memorable) representation of a longer digest, unique enough for display in a user interface, where a user may need to remember or verbally communicate the identity of a hash, without having to remember a 40-character hexadecimal sequence. Nevertheless, you should keep original digests around, then pass them through humanize() only as you’re displaying them.

How It Works

The procedure for generating a humanhash involves compressing the input to a fixed length (default: 4 bytes), then mapping each of these bytes to a word in a pre-defined wordlist (a default wordlist is supplied with the library). This algorithm is consistent, so the same input, given the same wordlist, will always give the same output. You can also use your own wordlist, and specify a different number of words for output.

Inspiration

  • Chroma-Hash - A human-viewable representation of a hash (albeit not one that can be output on a terminal, or shouted down a hallway).

  • The NATO Phonetic Alphabet - A great example of the trade-off between clarity of human communication and byte-wise efficiency of representation.

Metadata

Release files for humanhash3 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for humanhash3 0.0.6
File Size Uploaded Provenance Actions
humanhash3-0.0.6.tar.gz 5.4 kB Without provenance Details for humanhash3-0.0.6.tar.gz

Release files / humanhash3-0.0.6.tar.gz

Download URL humanhash3-0.0.6.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
89ae15f6034bdb07e53ac2b2e246cc7131940766d2b2b70b7398dd27c640b1ab
BLAKE2b-256 checksum
How to use checksums
0106733ffbb45b78c34eba21d72e71a67f44af6efcdfb2e31ccaa837eb5144be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for humanhash3 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page