Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Python 3 package for hashing strings to emojis.

Project description

Hash (unicode) strings to emoji(s). You can set the length.

Importing is as easy as from pymojihash import hash_to_emoji! hash_to_emoji() is the wonderful hashing function.

In this example a string is hashed to a single emoji:
>>> hash_to_emoji('lol')
There is a limited number of emojis outputs (see: emojis.json in this package) so if you increase the hash_length the less likely youa re to encounter different values which produce the same output/hash/emoji(s):
>>> hash_to_emoji('lol', 4)
>>> hash_to_emoji('lol', 2)
>>> hash_to_emoji('heck', 2)
'โ™ ๏ธ๐Ÿ‡จ๐Ÿ‡ฆ'
You can also exclude the flag emojis like this:
>>> hash_to_emoji('heck')
>>> hash_to_emoji('heck', no_flags=True)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pymojihash-0.4.0.tar.gz (5.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page