Skip to main content

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)
'😤'

Download files

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

Source Distribution

pymojihash-0.4.0.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file pymojihash-0.4.0.tar.gz.

File metadata

  • Download URL: pymojihash-0.4.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymojihash-0.4.0.tar.gz
Algorithm Hash digest
SHA256 af448fc715e477212e3ecf6c4c98cd017fcf9ae055e80dd31b66cc16fc29c960
MD5 0690f693ec605857757b6c2209f4fae2
BLAKE2b-256 f811740bdc7227988ade758759ce5b590b4e00c73ccd504d66307046bd478a26

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 file

0.3.0

2 files

0.2.0

1 file

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