rebus
Generate base64-encoded strings consisting of alphanumeric symbols only.
Why did I make this app?
Recently I have been working on implementing of a Google Authenticator app for Plone (which I did for my beloved company - Goldmund, Wyldebeast & Wunderliebe).
For generating of a bar code image, I needed a base32 encoded string. While Android devices could perfectly scan all bar-code image that I would generate, Apple devices would raise errors on bar code images which were generated using strings that contain one or more “=” characters.
The solution found was to add a number of \n at the end of the string to be encoded.
If you happen to experience similar problems, you know what to do.
Prerequisites
Python 2.6.8+, 2.7.+, 3.3.+
Installation
Install latest stable version from PyPI:
$ pip install rebus
…or latest stable version from GitHub:
$ pip install -e git+https://github.com/barseghyanartur/rebus@stable#egg=rebus
…or latest stable version from BitBucket:
$ pip install -e hg+https://bitbucket.org/barseghyanartur/rebus@stable#egg=rebus
Usage and examples
Using rebus is damn easy. Whenever you would want to use base64.b32encode or base64.b64encode, replace base64 with rebus.
Encoding
Required imports
>>> import rebus
b32encode string
>>> rebus.b32encode('abcdefg')
'MFRGGZDFMZTQUCQK'
b64encode string
>>> rebus.b64encode('abcdefg')
'YWJjZGVmZwoK'
urlsafe_b64encode
>>> rebus.urlsafe_b64encode('abcdefg')
'YWJjZGVmZwoK'
Decoding
It’s possible to decode string, encoded with rebus to their original values.
Required imports
>>> import rebus
b32decode string
>>> rebus.b32decode('MFRGGZDFMZTQUCQK')
'abcdefg'
b64decode string
>>> rebus.b64decode('YWJjZGVmZwoK')
'abcdefg'
urlsafe_b64encode
>>> rebus.urlsafe_b64decode('YWJjZGVmZwoK')
'abcdefg'
License
GPL 2.0/LGPL 2.1
Support
For any issues contact me at the e-mail given in the Author section.
Metadata
Release files for rebus 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rebus-0.2.tar.gz | 20.9 kB | Without provenance | Details for rebus-0.2.tar.gz |
Release files / rebus-0.2.tar.gz
| Download URL | rebus-0.2.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ca846a99019803fd52c0c34a12c5ee6598b763f956f105c503de738b6a0e4e5
|
|
BLAKE2b-256 checksum How to use checksums |
6698ea0b70cd99617dfa501f1218aec0e1b42e4a4294c43e4d3533975e8d2f35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rebus 0.2
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.