Skip to main content

Generate codes

Project description

codify

Generate codes

To install: pip install codify

Qr code

from codify.codify.qr_coding import qrcode_img_of

qrcode_img_of('https://github.com/thorwhalen')

png

And if you wanted to save that, you just do:

qrcode_img_of('https://github.com/thorwhalen').save('qr_code_of_my_website.png')

But qr codes aren't just for links. They're just a means to implement text->image->text error compressed and robust communication pipeline.

For example...

some_long_text = """Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. 
It was popularised in the 1960s with the release of Letraset sheets containing 
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
"""
qrcode_img_of(some_long_text)

png

Obviously, this could get out of hand.

But if all you're doing is wanting to send a fingerprint (a hash) of some text, for verification or legal purposes.

For this, you can use sha256 for example...

from codify.codify import bytes_to_sha256
from codify.codify.qr_coding import qrcode_img_of_sha256
bytes_to_sha256(some_long_text.encode()).hex()
'a1a2423753693304b35308d019a37bbb12b8e8c36e07c02d1e448f28927ea557'
qrcode_img_of_sha256(some_long_text)

png

Project details


Download files

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

Source Distribution

codify-0.0.5.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

codify-0.0.5-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page